Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 10 of 13

Thread: Transforming + Rotating an object without going weird?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    Junior Member Newbie
    Join Date
    Dec 2013
    Im not understanding this. Whatever order or whatever i select, it just doesn't work. I know i'm probably being dumb.
    glTranslatef(-0, -0, -plus);
    glRotatef(rotate, 0.f, 1.f, 0.f);
    glTranslatef(0, 0, plus);

    Oh i saw your edit. But i still just don't get it. I want to be able to drive the ship around with the arrow keys, im not understanding your points business :S.
    Also i would like to be able to translate and rotate at the same time.

    Now trying glTranslatef(0, 0, plus);
    if (Keyboard.isKeyDown(Keyboard.KEY_LEFT)){
    glTranslatef(0, 0, -plus);
    glRotatef(rotate, 0.f, 1.f, 0.f);
    glTranslatef(0, 0, plus);
    , it still isn't working. Even though the ship is at the centre it still rotate's around the ships spawn point when its translated back out.
    Last edited by joehot200; 12-19-2013 at 08:13 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts