Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

MichaelNolan

Cutting

This topic is 5541 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

Hey, I''ve been using glOrtho(...) to do my projection stuff. Lately, when i was creating my Camera Class i was using matrices but when the camera was suppost to get closer the object i tested it with vanished.
// Here is my first matrix
        float xyzPlane [16] =
        {
                1.0, 0.0, 0.0, 0.0,
                0.0, 1.0, 0.0, 0.0,
                0.0, 0.0, 1.0, 0.0,
                0.0, 0.0, 0.0, 1.0
        };
        glLoadMatrixf(xyzPlane);
// Here is my martix for translation
        CamX += .1;
        CamY += .1;
        CamZ += .1;
        float TranslationMatrix [16] =
        {
                AngX, 0.0, 0.0, 0.0,
                0.0, AngY, 0.0, 0.0,
                0.0, 0.0, AngZ, 0.0,
                CamX, CamY, CamZ, 1.0
        };
        glLoadMatrixf(TranslationMatrix);
// Here is my projection handling code
    if (w <= h)
        glOrtho (-nRange, nRange, -nRange*h/w, nRange*h/w, -nRange, nRange);
    else
	glOrtho (-nRange*w/h, nRange*w/h, -nRange, nRange, -nRange, nRange);
 
MICHAEL NOLAN

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
You are mis-understanding AngX, AngY and AngZ. Make sure those are all 1 in the second matrix.

Share this post


Link to post
Share on other sites
I''ve done everything i could think of. However, last night i found out what was wrong - i don''t know why - the CamZ was equal to over 1000

MICHAEL NOLAN

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!