Gamestudio Links
Zorro Links
Newest Posts
contractUpdate() is filtering if >2 rows
by mistery. 11/09/26 12:06
New Zorro version 3.15
by jcl. 11/09/26 09:24
Removing outliers from files
by jcl. 11/04/26 10:30
[MED] Import from FBX (2010) missing!!!
by rayp. 11/03/26 14:33
What are you working on?
by rayp. 11/02/26 13:57
No connection to MT4
by JeyKey II. 10/29/26 09:34
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (1 invisible), 21,732 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
MaliceTheMaker, Haitao_Ren, JimSimons, julienp, julienper
19248 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