projection matrix - OpenGL 3D Transformation: z-Aspect ratio -
I am launching 3D perspective in OpenGL (WebGL), I am doing it with uniform-matrix. Ever been working fine, but I have an aspect ration of 3: 2 (600 px x 400 px) and it is sung in all geometry.
In 2D, I get it in the model matrix through X and Y respectively 1 / width and 1 / height.
Now I have a life to worry too and I do not know how to distract z on my 3: 2 aspect ratio.
Model matrix does not offer any opportunity to do this and I do not know what to do / what to do in projection matrix.
Edit: Projection matrix:
@_ pMatrix = [1, 0.0, 0.0, 0.0, 0.0, 1, 0.0, 0.0, 0.0, 0.0, - ( F + n) / (f - n), -1, 0.0, 0.0, - 2.0 * n * f / (f - n), 0.0]
column head order
Editing 2: Strange Distortions on N & LT; 1
You do not want * left *, * right *, * top *, * down *
in your projection matrix.
2 * n ----- 0 0 rl 2 * n ----- 0 tb r + l t + b - (f + n) ---- - ----- ------ - 1 RL TB FN-2F * N 0 ------ FN
If you type in (RL) / (TB) = 3/2
The amount of viewing this way is the proper size for your model, then you should set.
Here are some slides describing various projection metrics, how they got:
They are the author of Edward Angel, where I found this matrix. Unfortunately, the OpenGL Red Book does not work at all through mathematics.
Comments
Post a Comment