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 1 of 1

Thread: Rolling ball at different angles

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2012

    Rolling ball at different angles

    Edit: SOLVED; glMultMatrixf() did work, I overlooked something.

    I'm trying to have a ball roll forward, that is, rotate along its x-axis. Works fine, but when I've moved the camera around the ball, I want it to still roll forward, straight away from the camera. When the camera rotates around the ball, the ball obviously doesn't rotate with it. So now I need to reset the rotation axes so that rotating around the x-axis would be the ball rolling straight away from the camera again, but without repositioning the ball.

    How do set the ball's texture coordinates 'free' from its rotation axes? There must be an easier way than to calculate the exact angle of every rotation axis with complex formulas. I spent 2 days trying to figure this out. glMultMatrixf() doesn't seem to do the job, since it only rearranges the modelview matrix.

    Any help is welcome
    Last edited by Katun; 11-19-2012 at 03:13 PM.

Posting Permissions

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