Sign in to follow this  
SiRobertson

Projection Matrix Help

Recommended Posts

SiRobertson    124
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
Fase    133
Hi,

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this