Results 1 to 4 of 4

Thread: setting camera position

  1. #1
    Guest

    setting camera position

    this may seems dumb, but cant help it. My proj. Anyone has any idea how to set the camera position without using Opengl, ie glulookat? My aim is to use the equivalent matrix generated by glulookat instead of the actual command itself. The prob is wat do I mutliply with the matrix to set the camera position. Thx

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,068

    Re: setting camera position

    I not sure of the matrix math, but you can do the same thing as glLookAt by using glTranslate and glRotate.

    So a translate would be add/sub function in matrix math.

    And rotate is a more complex, I guess a sin/cos function in the matrix.


    Originally posted by City-Hunter:
    this may seems dumb, but cant help it. My proj. Anyone has any idea how to set the camera position without using Opengl, ie glulookat? My aim is to use the equivalent matrix generated by glulookat instead of the actual command itself. The prob is wat do I mutliply with the matrix to set the camera position. Thx

  3. #3
    Member Contributor
    Join Date
    Apr 2002
    Posts
    94

    Re: setting camera position

    Multiplying your model vertices by the model matrix is how you "move" the camera. Moving the model away from the camera is equivalent to moving the camera away from the model (in the opposite direction). Same kind of thinking for rotating the camera also.
    P4 2Ghz, GEFORCE4, 512 Meg RAM, WIN2000, VStudio 6.0

  4. #4
    Guest

    Re: setting camera position

    Thx for the prompt reply. Appreciate it. So let me get this straight. To simulate a camera setup, all I need to do is perform matrix transformation on my model, is tt right? So how do I initialise my original view, ie. let's say, without glulookat, how do I specify where is my original camera position,ie let's say, I wanted my camera to be placed at the observer's view. How do I tell the program that I wanted that point as my camera? Perhaps I miss out some details in your explanations.

Similar Threads

  1. Cross-platform Setting Cursor Position
    By Omariko in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 03-05-2008, 01:17 PM
  2. Camera Position / Camera Angle / Camera Target Position
    By bobGL in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 04-02-2007, 09:28 AM
  3. Need help setting the camera
    By in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 02-25-2006, 12:17 AM
  4. Setting the mouse position
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 06-04-2003, 04:01 AM
  5. Setting up a camera
    By in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 05-12-2000, 04:19 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