Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualKaptein

Posted 25 October 2012 - 07:33 PM

to do rotations, you have to translate the object to its rotational origin, called a PIVOT position, then rotate it there, and translate it back!
if your object is a box created at (0,0) and all the way to (1,1), you have to translate it to (-0.5, -0.5) to rotate it around itself
however, if your box was created from (-0.5, -0.5) to (0.5, 0.5) you can rotate it immediately, because its rotational origin is now (0, 0) from the start, if you wanted to rotate it around itself!

3ds max (or any other 3d CAD) is a great tool to visualize how this works

to do the same thing with your model, you need to know its dimensions, and then its half-sizes, then translate it backwards so that the object is positioned with (0, 0) at the center of the object, then rotate it there (if that's what you wanted to do)

from looking at the ship creation code from the link.. its hard for me to understand how exactly it is created, except to say i never would be doing it that way myself :S
i'm sure theres some logic to it though!

#2Kaptein

Posted 25 October 2012 - 07:32 PM

to do rotations, you have to translate the object to its rotational origin, called a PIVOT position, then rotate it there, and translate it back!
if your object is a box created at (0,0) and all the way to (1,1), you have to translate it to (-0.5, -0.5) to rotate it around itself
however, if your box was created from (-0.5, -0.5) to (0.5, 0.5) you can rotate it immediately, because its rotational origin is now (0, 0) from the start, if you wanted to rotate it around itself!

3ds max (or any other 3d CAD) is a great tool to visualize how this works

to do the same thing with your model, you need to know its dimensions, and then its half-sizes, then translate it backwards so that the object is positioned with (0, 0) at the center of the object, then rotate it there (if that's what you wanted to do)

from looking at your ship code, or specifically, the example you posted.. its hard for me to understand how exactly it is created, except to say i never would be doing it that way myself :S
i'm sure theres some logic to it though!

#1Kaptein

Posted 25 October 2012 - 07:26 PM

to do rotations, you have to translate the object to its rotational origin, called a PIVOT position, then rotate it there, and translate it back!
if your object is a box created at (0,0) and all the way to (1,1), you have to translate it to (-0.5, -0.5) to rotate it around itself
however, if your box was created from (-0.5, -0.5) to (0.5, 0.5) you can rotate it immediately!

3ds max (or any other 3d CAD) is a great tool to visualize how this works

PARTNERS