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.

Dark GDK / Rotating vs turning and pitching

Author
Message
Trullion
15
Years of Service
User Offline
Joined: 1st Oct 2009
Location:
Posted: 19th Mar 2010 22:34
I have noticed that when I use the dbRotate commands the object is rotating to face what ever angle I specify.

On the other hand if I use the roll, turn, or pitch commands, then the angles break down into 90 degree quadrants.

Is there a way around this? The issue I am running into is that I need to rotate something about the Y-axis and then pitch its nose up or down about its own axis. The problem is that when I try to reference the dbObjectAngle property I find that it is now displayed in 90 segments insteaad of 360.
kklouzal
15
Years of Service
User Offline
Joined: 15th May 2009
Location: Arizona
Posted: 20th Mar 2010 03:00
I believe you are incorrect, dbObjectAngle returns 0 to 360 or -180 to 180, I can't remember which off the top of my head

Add me to your MSN!
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 20th Mar 2010 12:26
It is not recommended to mix local rotation functions (pitch, turn, roll) with global ones (rotate object).

If you need to use both, then do 1st the global rotation, and then all the local ones.

You can get the right object angle always if asking before performing the local rotations.
Then you can always know how much you locally rotated the object. Store those angles when performing any local rotations, you didn't explain why you need dbObjectAngle. After all, you have rotated it, so the angles are already known, ajem.

Trullion
15
Years of Service
User Offline
Joined: 1st Oct 2009
Location:
Posted: 22nd Mar 2010 23:30
I guess to elaborate, the problem I have here is that I need to roll an object to determine its rate of turn and then rotate it around the Y axis. In order to do this I am using three commands: dbPitchObjectUp, dbRollObjectRight, dbYRotateObject. I use the Roll command to determine the rate of turn and then calculate the step value to rotate the object around the Y axis. The problem is that as soon as I use either the pitch or roll command, the object Y angle jumps. While the object does not. Its almost as if the object angle is reset. I am not certain how to explain it, but if the object Y angle was 160 then it immediately changes to 20. Bear in mind all I am changing is the object pitch and the object roll, not the object Y angle. I'm not sure exactly why it does that but thats what it does. When I tried simply tracking the angle and then rotating it to that angle as suggested by Kklouzal, I end up with an object that jumps back and forth from 160 to 20. Its very wierd.

I did try this experiment though. I removed all of the rotate commands, and replaced them with dbTurnObjectRight. Then by tracking the angle as Kklouzal suggested, I also tracked the dbObjectAngleY. The end result was that the two angles were different. My local variable went from 0 to 360 while the sbObjectAngleY went from 0 to 90 to 0 to -90 to 0.
Trullion
15
Years of Service
User Offline
Joined: 1st Oct 2009
Location:
Posted: 30th Mar 2010 00:42
I finally created a movement routine that fixes the flying behavior, allowing me to turn the hang glider about the vertical axis for a coordinated turn, while also doing pitch and roll.

The movement routine first removes any roll and pitch values, using the dbRollLeft, and dbPitchDown commands. Then the toon is turned using the dbTurnRight command. Then the pitch and roll are put back in, in that order using the dbPitchUp and dbRollRight commands. Its still not perfect but it works pretty well.

Login to post a reply

Server time is: 2024-11-20 03:52:17
Your offset time is: 2024-11-20 03:52:17