Results 1 to 5 of 5

Thread: Does gluLookAt work with gluOrtho2D

  1. #1

    Does gluLookAt work with gluOrtho2D

    I am trying to create a camera that moves in 2D space along the x,y coordinates, will gluLookAt allow me to accomplish this, when I have gluOrtho2D projection?

    thanks

  2. #2
    Member Contributor
    Join Date
    Jul 2002
    Location
    Southampton, PA, USA
    Posts
    61

    Re: Does gluLookAt work with gluOrtho2D

    I don't see why not. Just make sure that the camera position and the target positions share the same X and Y coordinates so you are looking straight down.

    However, you might as well just use your own calls to glTranslate and glRotate if you are only working in two dimensions.

  3. #3

    Re: Does gluLookAt work with gluOrtho2D

    would the translatef and rotate the entire scene be more efficient than using a camera?

    I have a really complex scene, and i need to track an object that moves around the scene, so that the object is always in view, and i was thinking have the camera move with it.

    but i dont know if translating and rotateing the entire scene would be better

    any ideas? thanks

  4. #4
    Senior Member Regular Contributor
    Join Date
    Apr 2003
    Location
    Toulouse, France
    Posts
    133

    Re: Does gluLookAt work with gluOrtho2D

    that is the same.
    if you kwow the position of the object and its orientation (angle around the z axis), use glTranslate + glRotate.
    if you don't have the angle but you have the direction vector (or velocity) of the object, then use gluLookAt.

    the 2 methods will produce the same effect so use the one which match your already computed object/ship/... parameters.

  5. #5
    Member Contributor
    Join Date
    Jul 2003
    Location
    va beach
    Posts
    63

    Re: Does gluLookAt work with gluOrtho2D

    I know that gluLooakAt does work with glOrtho not sure about glOrtho2D though. I don't see a reason it shouldn't though.

Similar Threads

  1. How does gluLookAt() work with gluPerspective()?
    By myst_iori in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 06-08-2011, 01:25 PM
  2. How do this viewport() and gluOrtho2d work?
    By myst_iori in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 06-03-2011, 11:37 AM
  3. gluLookAt doesn't work
    By Sarah22 in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 04-20-2009, 02:12 PM
  4. gluLookAt, can you work out how much it sees?
    By Andrew Davey in forum OpenGL: Basic Coding
    Replies: 13
    Last Post: 04-29-2004, 06:19 PM
  5. gluLookAt - does it work? (or am i too stupid :-)
    By Schleppi in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 04-23-2001, 12:07 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