Results 1 to 5 of 5

Thread: changing viewpoint

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2002
    Posts
    22

    changing viewpoint

    How do I change the viewpoint, in order to walk around my world, by the directions left, right, foreward, backward, up, down? Depending on where on is in the world, left isn't always a negitive y movement.

    Jenny

  2. #2
    Senior Member Regular Contributor
    Join Date
    Dec 2001
    Location
    Belmont, CA, USA
    Posts
    216

    Re: changing viewpoint

    As long as you rotate before you translate, left is always along the negative Y axis.

  3. #3
    Junior Member Newbie
    Join Date
    Jul 2002
    Posts
    22

    Re: changing viewpoint

    is there a way to do it with gluLookAt? or a way to do it with vector math? Or a way to do it that isn't dependant on if i rotate first? I'm adding this stuff to an already existing program, so i'd prefer to have to place as few restrictions on the other code as I can.

    I was hoping that i could store an eye-position, and a camera-position, and allow the user movement and rotation controls and manipulate the model matrix from there. Since I want to store the change from the initial state to the current state, I think it would be easier to store the total change, rather then a summation of all the changes so far . .. . .

    Or am I making this harder on myself then it really is???

    [This message has been edited by jenny (edited 08-13-2002).]

    [This message has been edited by jenny (edited 08-13-2002).]

  4. #4
    Senior Member Regular Contributor
    Join Date
    Feb 2002
    Posts
    374

    Re: changing viewpoint

    Originally posted by jenny:
    is there a way to do it with gluLookAt? or a way to do it with vector math?
    I am using gluLookAt for all my different types of cameras and it is really easy. Since gluLookAt takes an eye-vector, center-of-scene-vector and an up-vector as input, you just have to manipulate these vectors the way you want them using ordinary vector math. It is helpfull to use a right-(or left) vector, too, so that you can easily calculate a new up-vector as the crossproduct of the view-vector and the right vector.

    hope this helps


    [This message has been edited by satan (edited 08-14-2002).]

  5. #5
    Junior Member Newbie
    Join Date
    Jul 2002
    Posts
    22

    Re: changing viewpoint

    Thanks for the suggestions . . .after many changes to my code, I'm going with the rotate and translate method . . .

Similar Threads

  1. Changing states vs Changing context
    By Yossi Koren in forum OpenGL: Basic Coding
    Replies: 12
    Last Post: 10-08-2017, 01:56 PM
  2. Moving a light when changing the viewpoint
    By Lefteris in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 01-18-2010, 04:18 PM
  3. Changing a viewpoint of an object without cam move
    By heavenssake007 in forum OpenGL: Basic Coding
    Replies: 7
    Last Post: 01-21-2009, 01:21 AM
  4. Light always coming from viewpoint.
    By paros in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 12-08-2008, 01:55 AM
  5. Viewpoint Movement
    By plates in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 12-31-2001, 07:49 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
  •  
Proudly hosted by Digital Ocean