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.

Newcomers DBPro Corner / Yrotate VS. Turn Object L/R

Author
Message
River
21
Years of Service
User Offline
Joined: 16th Jun 2003
Location:
Posted: 17th Jun 2003 02:03
Hello, first post, more to come I'm sure...

Is there a difference in the way DB handles a Yrotation versus the Turn Object command?

I'm having trouble getting a tank turret and barrel to rotate correctly...If I raise the barrel (x-axis) it's fine if my Yrotation is 0. However, if I'm say 45 degrees on Y, I try to raise the barrel and the entire object rotates on the x axis. I would like the rotation to be local to the object's new Y position...

I wonder if this is making any sense...

Please chime in, thank you.

-R
Uriel The Ignoble
21
Years of Service
User Offline
Joined: 13th Jun 2003
Location: In a tiny box in the attic
Posted: 17th Jun 2003 02:14
i thought i had an answer for u, but i realized i dont.. the difference in the index is that turn object is "independent of any axis" but i dont know what that means..
good question.. i hope someone else knows

Moggie100
22
Years of Service
User Offline
Joined: 15th Oct 2002
Location: Behind You...
Posted: 17th Jun 2003 02:18
There is a difference, but it isnt noticeable until you try to turn the object in another axis.
The commands:

pitch object up
pitch object down
turn object left
turn object right
roll object right
roll object left

all use the object orientation to set the axis, so no matter how many degrees you turn the object the z axis (used in the 'roll object' command) will always be going through the object's front and back. Likewise the X axis (used in the 'pitch object' command) will always go from one side of the object to the other. Ditto for the Y axis (used in the 'turn object' command).

Whereas the rotate commands:

rotate object
yrotate object
xrotate object
zrotate object

use static axes - ie the Z axis will always go from the front to the back of the game area, the X axis will always go from the right to the left side of the game area, and the y axis will always be going up and down through the game area. These will remain in this oriantation throughout the program.

Hope that answers your question - feel free to ask anything else
Happy Coding - Mog

Moggie100
22
Years of Service
User Offline
Joined: 15th Oct 2002
Location: Behind You...
Posted: 17th Jun 2003 02:25
btw - 'independent of any axis' means it works on the object local orientation and ignores any game axes.

River
21
Years of Service
User Offline
Joined: 16th Jun 2003
Location:
Posted: 17th Jun 2003 03:10
That makes sense, I'll give it a whirl and let you know how it goes.

Thanks Mog

R
River
21
Years of Service
User Offline
Joined: 16th Jun 2003
Location:
Posted: 17th Jun 2003 04:10
Ok, I've dicked with it (can I say "dicked") and I'm out of rope. Before I heave my 20" monitor out my office window, I thought someone with the Big Brain could tackle this puzzle.

I put limits on the barrel range (6 to -89). All is cool as long as either X or Y = 0. As soon as either change, the rotation doesn't behave. I guess I'm used to Studio Max Euler Contollers. If y=-180, the barrel inputs are reversed. I'm thinking I have to incorperate a Z-rotation if y=90 or 270, and curve it that way, but I really shouldn't have to do that...right?

WHO SHALL SAVE ME? THOU? YE?

Thanks again,
-R
Moggie100
22
Years of Service
User Offline
Joined: 15th Oct 2002
Location: Behind You...
Posted: 17th Jun 2003 15:17
Can you redescribe that please?

River
21
Years of Service
User Offline
Joined: 16th Jun 2003
Location:
Posted: 17th Jun 2003 20:05
M,

Run the code I posted ( ^ ), I'm using TURN and PITCH instead of rotation, but I'm getting the same (unwanted) results. I've also noticed that using a combination (A Y-rotate and an X-Pitch) seems to lock the object down.

The game will eventually be a 3d Tank game, 2-player, someday. The players will take turns trying different Gun Angles, and Blast Velocites, + wind/gravity, and of course the tanks can move. The HUD will show your gun angle, a mini-radar or compass, the last shot and how far you missed your target, so you can hone in and get the bad guy. I'm thinking I may need to just learn how to deal with models (.x) and limbs, since there's a quirk to this rotation thing which is baffling me. I guess I'm in the right place for help...

Thanks a lot for helping, by the way.

-R
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 17th Jun 2003 21:16 Edited at: 17th Jun 2003 21:16
This code work I think.

Your problem is you have these lines, incremnting the two angles:



Then you rotate it again adding even more on.

This means your object always rotates more than the angle, so even if your angle is being stopped the rotation isnt.

You are the th person to view this signature.
Programmers don't die, they just Gosub without return....
River
21
Years of Service
User Offline
Joined: 16th Jun 2003
Location:
Posted: 17th Jun 2003 21:30
David,

The first two line inside the loop resets the angle changes back to zero. My TurretX & Y variables don't change if no key is entered...

I'm still trying to isolate the angles, local to the Turret. Is this possible?

Thanks!
-R
River
21
Years of Service
User Offline
Joined: 16th Jun 2003
Location:
Posted: 17th Jun 2003 21:37
BTW, I did try to rotate the limb (Barrel), but the the pivot point is the center of the barrel. This may be one solution, but I would have to move the pivot to the center of the turret, so the gun raises normally.

Danka.

-R

Login to post a reply

Server time is: 2024-11-24 18:31:32
Your offset time is: 2024-11-24 18:31:32