simple very simple question for the smarter people

Started by
8 comments, last by GameDev.net 24 years, 5 months ago
translate the object by (5,1,0),
then rotate
Advertisement
Not quite. Rotate it first then translate it. The last case mentioned is only true if your using OpenGL's glRotate and glTranslate functions. But in everything else you always rotate then translate .

--TheGoop

i think i asked the question wrong.

-----.(0,0,0)-----.(5,0,0)-

i want to rotate it around (5,0,0)
then it would look like

\
\
\. (0,0,0)
\
\
.(5,0,0)

whooooooooops

' -------.(0,0,0)---------.(5,0,0)
' point a point b
. \
. \
. \. a (?,?,0)
. \
. \
. \
. . point b still (5,0,0)
.

i want to rotate the whole object around point b. if you just rotate the object it would rotate around point a.

Actually, TheGoop, I believe in this case you translate first to get the pivot point (5,1,0) on the origin, then you rotate, then translate backwards to place the pivot point back where it was originally.

Or am I just completely wrong?

- Splat

You make that point (5,1,0) at (0,0,0)...and then you rotate.

------------------
Dance with me......

how would you do that?
but you see i want to rotate it in many different points.
lets say i haaave two points in an object
__________________
¯¯¯¯¯| |¯¯¯¯¯¯¯¯¯¯\\
------------------/¯¯¯¯¯¯\
_________________| . (5,1,0) point W
. (0,0,0) point X\______/

i use d3dim btw..
if i rotate the object it rotaates around (0,0,0)..
but i want the object to rotate around (5,1,0).. how would i go about doing that?
do i translate point X? or rotate the whole object then translate itsomewhere? how?!

this is pretty basic. If you want to rotate an object around any point (x, y, z), first just translate it by (-x, -y, -z), then apply your rotation, and translate it again by (x, y, z) to put it back where it was.

[This message has been edited by Myopic Rhino (edited November 08, 1999).]

This topic is closed to new replies.

Advertisement