Author Topic: This one should be easy. glTranslatef ?  (Read 2315 times)

0 Members and 1 Guest are viewing this topic.

Offline ScottyBrosious

  • C= 64
  • **
  • Posts: 25
  • Karma: 3
    • View Profile
This one should be easy. glTranslatef ?
« on: December 30, 2006 »
gltranslatef(x,y,z)

Say I wanna position something at
glTranslatef(-30,0,0)

then rotate it (just) around that point
how do I do it without it revolveing all around the screen?

then also
next object at

glTranslate(-15,0,0)

it rotateing around just that point also
without revolveing all around the screen?

last question
do I also have to glTranslatef(0,0,0) before second objoect?

Please would someone explain to me
glTranslatef()
and also how to rotate some oject around that point (only)?

Thanks
and some short code would be nice


Offline taj

  • Bytes hurt
  • DBF Aficionado
  • ******
  • Posts: 4810
  • Karma: 189
  • Scene there, done that.
    • View Profile
Re: This one should be easy. glTranslatef ?
« Reply #1 on: December 30, 2006 »
Hi scotty the trick is to do things in reverse in opengl.

So
glTranslate (x,y,z)
glRotatef (ang,1,1,1)
drawobject...

will do what you want.
Challenge Trophies Won: