Jump to content
  • Advertisement
Sign in to follow this  

Projection Matrix Help

This topic is 3671 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 guys, For the last week or so I have been trying to create a projection matrix without success, I have read through numerous gamedev articles related to projection matrices but for one reason or another they have failed to provide a solution. I am posting this question here as a last resort and I really hope you guys are able to help me with this. This is the environment I am working in:
viewWidth   = 640
viewHeight  = 360
fieldOfView = 80
focalLength = 381
The coordinate system is a bit odd due to the fact I am working with ActionScript 3.0 here:
positive X = left to right
positive Y = top to bottom
positive Z = into the view (away from the screen)
The matrices I am working with are 4x4 and are row-based and stored as a single array. The upper-case character represents the vector, the lower-case character represents the component:
matrix[ Xx, Xy, Xz, Xw, Yx, Yy, Yz, Yw, Zx, Zy, Zz, Zw, Wx, Wy, Wz, Ww ]
Finally, I am working with euler angles. If anyone can show me (in Layman's terms) how to generate a projection matrix I would be extremely grateful. Thanks.

Share this post

Link to post
Share on other sites

Maybe the internals of GluPerspective is what you're looking for:
Although I'm not sure how to translate focal length to zNear and zFar.

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!