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

Ask A Question

Stats

  • Questions 111k
  • Answers 111k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer History shows that any feature that allows players to interact… May 11, 2026 at 9:48 pm
  • Editorial Team
    Editorial Team added an answer Thanks for the Robert Scott link. I found a way… May 11, 2026 at 9:48 pm
  • Editorial Team
    Editorial Team added an answer Your existing approach of storing this info in the DB… May 11, 2026 at 9:48 pm

Related Questions

I am making an application that does some custom image processing. The program will
I am creating a simple 2D OpenGL application but I seem to be experiencing
For some reason when I resize my OpenGL windows, everything falls apart. The image
If you've used Memcheck (from Valgrind) you'll probably be familiar with this message... Conditional
I want to use the mouse scrollwheel in my OpenGL GLUT program to zoom

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.