Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (degenerate_762, AbrahamR, AndrewAMD, ozgur), 667 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 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 | chip programmers | 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