Results 1 to 3 of 3

Thread: camera rotation

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2001
    Posts
    16

    camera rotation

    Could you help me? I got a camera and I want to rotate it around a point(model) with radius, which I want. Help me, please!

    And one more do you know where I can find any car physics tutorial or demos!

    Thanx.

  2. #2
    Senior Member Regular Contributor
    Join Date
    Oct 2000
    Location
    Donetsk,Ukraine
    Posts
    118

    Re: camera rotation

    glTranslatef(mx,my,mz);//translate to the center of model
    glRotatef(a,1,0,0);//rotate camera
    glTranslatef(0,0,r);//translate on a radius in direction, orthogonal to rotation axis

    Hope this works.
    Randy, http://www.geocities.com/udodenko

  3. #3
    Member Newbie
    Join Date
    Feb 2001
    Location
    Atlanta Georgia
    Posts
    32

    Re: camera rotation

    I am not sure whether the code above works or not, but it should be as simple as translate radius out from the origin, rotate by a clock variable, then translate by the central position of the model, leaving the camera radius away, rotated around the model.

    Be careful to implement your camera correctly, by making inverse motion changes to the modelview matrix to give the impression a camera. You may want to use an external matrix class to model the motion, then pass it into OpenGL using glLoadMatrix(), this will be much faster than using opengl as a mathlib, and easier to work with.

    If you can get your hands on a high school physics book, you should be able to get the kinematics out of it.
    "Close before striking. Keep away from Children"--Strike on the box matches.

Similar Threads

  1. Camera not rotation
    By tritZium in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 03-24-2015, 10:59 AM
  2. Camera Rotation
    By ncikw in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 12-13-2011, 11:32 AM
  3. camera rotation
    By javalurnin in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 12-21-2009, 11:56 AM
  4. camera rotation
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 10-25-2003, 07:54 AM
  5. About rotation of a camera
    By in forum OpenGL: Basic Coding
    Replies: 8
    Last Post: 12-15-2001, 04:03 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
  •  
Proudly hosted by Digital Ocean