Jump to content
  • Advertisement

Archived

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

MichaelK

Mistake in OpenGl game programming book

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

Hi. I just bought the OpenGl game programming book and up until now I think it''s great. I''m currently in the math section on page 82 and I''m trying to understand what is going on with the perspective matrix, but something doesn''t seem to be right. When the author multiplies the perspective matrix by a point vector matrix at the top of the page he gets a final matrix, but I just can''t get that matrix when I multiply. Am I multiplying wrong or is there a typo. Any help would be appreciated. Michael If anybody knows how I can e-mail one of the authors that would be great I can''t seem to find their addresses on this web site. I''m kinda new.

Share this post


Link to post
Share on other sites
Advertisement
It is wrong. The result is correct, but the matrix is wrong. The matrix they show is the transpose of the matrix it should be. Most books on computer graphics show a transform being done by a transform matrix times a column vector. OpenGL uses a row vector times a transform matrix. The matrix used in one case is the transpose of the matrix used in the other. The transpose is switching the rows and columns if that makes any sense to you. In that particular matrix you just swap the -1 in the last row with the 1/focus in the last column.

Share this post


Link to post
Share on other sites
Thanks. I thought something was fishy. I was pretty sure I knew how to multiply matrices after my linear algebra class.

Thanks again,

Michael

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.

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!