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 Professional Discussion / Are turn object angles supposed to be like this ?

Author
Message
GatorHex
18
Years of Service
User Offline
Joined: 5th Apr 2005
Location: Gunchester, UK
Posted: 14th Mar 2007 01:49 Edited at: 14th Mar 2007 01:52
Are turn object angles supposed to be like this ? They do a stange 180 spin around if you copy the angle to another object.





I know you can work around this issue by using yrotate 0-359 but I'm just wondering if this is a bug with turn object left/right or have I missed a strange command that can fix the angles returned by the object?

http://www.KumKie.com http://bulldog.servegame.com
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 14th Mar 2007 01:58
Yes ... because you are using the "freeflight" or "free motion" commands. Turn/roll/pitch/yaw object and etc breaks the rules of eular angles. Only the rotate object commands (x,y,zrotate and rotate) keep the angles as you would expect.

GatorHex
18
Years of Service
User Offline
Joined: 5th Apr 2005
Location: Gunchester, UK
Posted: 14th Mar 2007 02:01 Edited at: 14th Mar 2007 02:17
What if i want fly a plane and shoot a bullet in the direction it is going? it's gona shoot out of it's arse from time to time is there any way to sort this?

shouldn't the angle be 89,90,89?

I suppose I might be able to do test for -90 and replace it with 90 , i better test it

http://www.KumKie.com http://bulldog.servegame.com
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 14th Mar 2007 05:21
I personally would use EZRotate instead of the built in DBP commands. This way you get all kinds of cool global and local rotations and keep your angle feedback in tact.

Nicholas Thompson
19
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 14th Mar 2007 12:31
Although that angle may have jumped from +90 to -90, its likely one of the other components have also switched 180 (usually X axis I think).

[center]
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 14th Mar 2007 13:01
Quote: "Although that angle may have jumped from +90 to -90, its likely one of the other components have also switched 180 (usually X axis I think)."


That is what is happening. GatorHex, DBpro uses Euler angles to describe rotation. Euler angles are difficult to understand because people try to use the X, Y or Z anles individualy. Euler angles should ALWAYS a set of three rotations. I don't know why DBpro even has the XROTATE, YROTATE and ZROTATE commands. They just help add to the confusion. When you use those commands, rotation on all 3 axis still does occur. DBpro just subsitutes your previous values for the other 2 angles. You should use the "ROTATE OBJECT objNo, x, y, z" commands.
When the rotation is applied it is always from zero. First, your object is rotated on the global X axis by the X value. Then, it is rotated from that position on the global Y axis by it's Y value. Then, from that position, it is rotated on the global Z axis by the z value. This all seems to happen at once (which adds to the confusion of trying to work with individual angles) but it happens in that defined order.

You can get a copy of the free version of EZrotate from my site:
http://www.gametoolshed.com
If you like what you see, then consider getting the Enhanced version. I definately recommend it if you are trying to do complex things with your object's rotations. It will definately make your life easier.
http://darkbasicpro.thegamecreators.com/?f=ezrotate

Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 14th Mar 2007 16:00
Rotating on 2 axis in DBPro is nice and simple, just use limb 0 to rotate one axis, and rotate object for the other - for 3 axis rotation, listen to Mr.Wolf .


Good guy, Good guy, Wan...

Login to post a reply

Server time is: 2024-03-28 12:46:55
Your offset time is: 2024-03-28 12:46:55