Advertisement Jump to content
Sign in to follow this  
stringa

is this OpenGL Matrix form for a camera

This topic is 3856 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm just curious if I have the correct idea on how OpenGL stores matricies in memeory camera_matrix_ is a float[16]
[source:c++]
    camera_matrix_[ 0] = final_right.x_;
    camera_matrix_[ 1] = final_up.x_;
    camera_matrix_[ 2] = final_look.x_;
    camera_matrix_[ 3] = 0.0f;
    camera_matrix_[ 4] = final_right.y_;
    camera_matrix_[ 5] = final_up.y_;
    camera_matrix_[ 6] = final_look.y_;
    camera_matrix_[ 7] = 0.0f; 
    camera_matrix_[ 8] = final_right.z_;
    camera_matrix_[ 9] = final_up.z_;
    camera_matrix_[10] = final_look.z_;
    camera_matrix_[11] = 0.0f; 
    camera_matrix_[12] = - position_.x_;
    camera_matrix_[13] = - position_.y_;
    camera_matrix_[14] = - position_.z_;
    camera_matrix_[15] = 1.0f;





[Edited by - stringa on June 29, 2008 7:36:35 PM]

Share this post


Link to post
Share on other sites
Advertisement
I think using the camera matrix to understand OpenGL matrices is a bad idea, because the camera matrix is
usually transposed in the first place.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!