OpenGL help

This is a discussion on OpenGL help within the Game Programming forums, part of the General Programming Boards category; Dear Seniors! I am new to OpenGL and trying to use the utility function "gluLookAt" and it just start rotating ...

  1. #1
    Registered User
    Join Date
    Jul 2004
    Posts
    4

    Unhappy OpenGL help

    Dear Seniors!

    I am new to OpenGL and trying to use the utility function "gluLookAt" and it just start rotating the object and giving a very different behaviour.

    Can anybody tell me the complete concept of this API, and how to use it.

    Thanx

  2. #2
    The Right Honourable psychopath's Avatar
    Join Date
    Mar 2004
    Location
    Where circles begin.
    Posts
    1,070
    now....i'm pretty new to OpenGL myself, but i do understand the gluLookAt(); function and how it works so...

    the gluLookAt function looks like this:
    gluLookAt(PositionX, PositionY, PositionZ, ViewX, ViewY, ViewZ, UpX, UpY, UpZ);

    the way i like to think of it, is the Position values, position the "feet" of the camera, the view values position the "eye" of the camera, and the up values simply specify which plane is up.

    my values for gluLookAt are as follows:

    PositionX = 0.0;
    PositionY = 0.8;
    PositionZ = 5.0;
    ViewX = 0.0;
    ViewY = 0.8;
    ViewZ = 0.0;
    UpX = 0.0;
    UpY = 1.0;
    UpZ = 0.0;

    those values work, assuming you have your glPerspective set-up like so:

    Code:
    gluPerspective(50.0f, 1.0f, 0.1f, 25.0);
    hope that helps

    -psychopath

  3. #3
    Banned
    Join Date
    Dec 2003
    Posts
    367
    A little advice: use the search feature of the message board.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linking OpenGL in Dev-C++
    By linkofazeroth in forum Game Programming
    Replies: 4
    Last Post: 09-13-2005, 11:17 AM
  2. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 01:34 PM
  3. OpenGL .dll vs video card dll
    By Silvercord in forum Game Programming
    Replies: 14
    Last Post: 02-12-2003, 07:57 PM
  4. OpenGL and Windows
    By sean345 in forum Game Programming
    Replies: 5
    Last Post: 06-24-2002, 11:14 PM
  5. opengl code not working
    By Unregistered in forum Windows Programming
    Replies: 4
    Last Post: 02-14-2002, 10:01 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21