Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Is dbObjectAngleY() Broken?

Author
Message
Zapleaf
14
Years of Service
User Offline
Joined: 16th Oct 2009
Location:
Posted: 13th Oct 2011 16:39
I can not get it to show the real angle of the character I point it at. It goes up and down from 90. Shouldn't it go up to positive 180 and down to negative 180, or make a complete cycle of 359 and wrap around?
BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 13th Oct 2011 18:25
Are you using the free flight rotation commands (TURN OBJECT RIGHT, TURN OBJECT LEFT, etc)?

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Zapleaf
14
Years of Service
User Offline
Joined: 16th Oct 2009
Location:
Posted: 14th Oct 2011 01:45 Edited at: 14th Oct 2011 02:54
Yes, I am actually.


Thanks for getting my brain on the right track! With your comment I made this new code, and it works like a charm!
dbRotateObject(CHARACTER, 0, dbWrapValue(g_nAngleY++), 0);
BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 14th Oct 2011 04:44
Yeah the FFR commands use what's known as Euler rotation. Honestly, I've never really been able to get a handle on how to use them effectively if you need feedback (such as angles and such), and they seem to frequently give really off values, which yield things like oscillating angle values (on account of another axis completely being flipped).

It caught me off guard the first few times. I usually just stick with ROTATE OBJECT based commands, they seem to do the trick.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose

Login to post a reply

Server time is: 2024-04-20 01:11:21
Your offset time is: 2024-04-20 01:11:21