nope; it didn't happen. i realized that i can't have the object roll and be rotated on the universal y-axis at the same time since the program will atempt to allign the object with the y-axis. I tried using a combination of roll object, turn object right, and pitch object up. If you think about it, if you tilt an object, rotating it also requires pitching it up also. At 0 degrees tilt, it requires all turn and no pitch, but at 90 degrees tilt,you need only to pitch it up to rotate it. If it is at 45 degrees, it needs to be turned and pitched up at the same rate.
I came up with this:
if ( dbRightKey()== 1 )
{
dbPitchObjectUp( 3 , dbObjectAngleZ ( 3 ) /90 *3 );
dbTurnObjectRight (3 ,3-dbObjectAngleZ(3)/90 *3 );
dbRollObjectRight ( 3 , 3 );
}
If you the examples above, if the object is not tilted at all, angle Z = 0, then 0 / 90 = 0, so it should be pitched up 0. (*3 was just for increased speed of turn) 3 - the same operation whose result was 0, is 3 so it should be turned right 3.
If you use a tilt of 45 degrees, 45/90 = 0.5, times 3 is 1.5, so the object should be pitched up 1.5. The remaining, whichis 3 minus that, or 1.5, is given to dbTurnObjectRight. And so on with any other value of tilt.
The only problem is that dbObjectAngleZ gives a value of the object's tilt based on a universal axis, not based on the object's own. Therefore, if the object is tilted, while facing the z-axis, the dbObjectAngleZ will not change at all, and will change at different rates while tilting and facing different angles. Anyone know how I can get the Objects Z angle that is not based on the universal Z-axis???
.__.....__........__
|__.._.|__)/|./|./..\
|(_||/_|__).|..|.\__/