Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 204135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:26:26+00:00 2026-05-11T17:26:26+00:00

In my glut application I’m simulating a plane with the camera. When the planes

  • 0

In my glut application I’m simulating a plane with the camera. When the planes speed is low I intend to have the nose start to point towards the ground as the camera falls. My first instinct was to just change the pitch until it was pointed downwards at -90degrees. However I can’t just change the pitch because if the plane is tilted on its side or upside down then it would note be changing direction towards the ground.

Now i’m trying to do a rough simulation of this by shifting the ‘lookAt.y’ downwards. To do this I am trying to get all the current camera coordinates that I use to set the camera
(eye.x, eye.y, eye.z, look.x, look.y, look.z, up.x, up.y, up.z). Then recall the set with the new modified values.

I’ve been working with the Camera.cpp and Camera.h to control my camera functions. They can be found here

after adding methods to get all the values, only the eye values are actually updated when various camera motions are made. I guess my question is how do I retrieve these values.

The glLoadMaxtrix call is in this function

void Camera :: setModelViewMatrix(void)

{ // load model view matrix with existing camera values

    float m[16];

    Vector3 eVec(eye.x, eye.y, eye.z);

    m[0] =  u.x; m[4] =  u.y; m[8]  =  u.z;  m[12] = -eVec.dot(u);

    m[1] =  v.x; m[5] =  v.y; m[9]  =  v.z;  m[13] = -eVec.dot(v);

    m[2] =  n.x; m[6] =  n.y; m[10] =  n.z;  m[14] = -eVec.dot(n);

    m[3] =  0;   m[7] =  0;   m[11] =  0;    m[15] = 1.0;

look.x = u.y; look.y = v.y; look.z = n.y; 

    glMatrixMode(GL_MODELVIEW);

    glLoadMatrixf(m);

}

Is there a way to get ‘eye’, ‘lookAt’, and ‘up’ values from the matrix here? Or should I do something else to get these values?

-Thanks in advance for your help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T17:26:26+00:00Added an answer on May 11, 2026 at 5:26 pm

    The camera class you link to is not an actual OpenGL class, but it should be simple enough to work with.

    The function quoted just takes the current values of the camera object and sends them to OpenGL. If you look at the camera’s set function, you can see how the program calculates the values it actually stores.

    The eye value is stored directly. The lookAt value is just the value of (eye – n), by vector math. The up value is the hardest, but if I remember my vector math correctly, I believe that up = (n cross u).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have two separate programs: (1) a GTK GUI; (2) a Glut application
What are the basic steps to compile an OpenGL application using GLUT (OpenGL Utility
I'm writing a simple OpenGL application that uses GLUT . I don't want to
Is it easy to create GLUT pop-up menus for my OpenGL application? If yes,
I have written a game that uses GLUT, OpenGL and FMOD. The problem is
Hey, I'm creating a little GLUT application and need help with hiding/removing the console
I'm making a Win32 application with OpenGL in the main window (not using GLUT).
I have the bare bones of a GLUT app. When I compile it for
I have gotten the GLUT 3.7 source and opened the MSVC project. I switched
I'm trying to use GLUT (freeglut) in my OpenGL application, and I need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.