Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,388 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
vec_to_ang problems - I cant get a Euler angle to an object! #330052
06/25/10 11:38
06/25/10 11:38
Joined: Jan 2010
Posts: 40
Adelaide, Australia
Sub_Game Offline OP
Newbie
Sub_Game  Offline OP
Newbie

Joined: Jan 2010
Posts: 40
Adelaide, Australia

I'm having a lot of trouble doing the simple calculation of a Euler angle from 2 3D locations. This is my attempt that should have turned my_unit to face force_ent. It has no effect at all.

Code:
vec_set(tempVector, force_ent.x);
vec_sub(tempVector, my_unit.x);
vec_to_angle(my_unit.pan, tempVector);



I have tried several other ways but vec_to_angle returns extreme results.

Help please!


A7 Commercial
First person submarine combat simulator project
http://alexanderforeman.webs.com/fightersubgame.htm
Re: vec_to_ang problems - I cant get a Euler angle to an object! [Re: Sub_Game] #330065
06/25/10 14:12
06/25/10 14:12
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
This code looks fine to me. There must be something wrong with the rest of your code!

EDIT: The pointers are correct? Make sure you do not reset the angle somewhere else.

Last edited by Superku; 06/25/10 14:15.

"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: vec_to_ang problems - I cant get a Euler angle to an object! [Re: Superku] #330138
06/25/10 21:45
06/25/10 21:45
Joined: Jan 2010
Posts: 40
Adelaide, Australia
Sub_Game Offline OP
Newbie
Sub_Game  Offline OP
Newbie

Joined: Jan 2010
Posts: 40
Adelaide, Australia
Cool - I will dig through my code. I thought I was going mad!


A7 Commercial
First person submarine combat simulator project
http://alexanderforeman.webs.com/fightersubgame.htm
Re: vec_to_ang problems - I cant get a Euler angle to an object! [Re: Sub_Game] #330355
06/27/10 08:01
06/27/10 08:01
Joined: Jan 2010
Posts: 40
Adelaide, Australia
Sub_Game Offline OP
Newbie
Sub_Game  Offline OP
Newbie

Joined: Jan 2010
Posts: 40
Adelaide, Australia
Thanks superku - you were correct. My pointers were suspect.


A7 Commercial
First person submarine combat simulator project
http://alexanderforeman.webs.com/fightersubgame.htm

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1