// pipe->Width() == 800
// pipe->Height() == 600
float yon = 500.0f;
pipe->SetFOV(60.f, int32_t(60.f * pipe->Height() / pipe->Width()));
pipe->SetDepth(0.3f, yon);
Resulting matrix is (as represented in memory):
Proj: hsMatrix44[[1.7321, 0.0000, 0.0000, 0.0000]; [0.0000, 2.4142, 0.0000, 0.0000]; [0.0000, 0.0000, 1.0006, -0.3002]; [0.0000, 0.0000, 1.0000, 0.0000]]
hsVector3 up;
hsPoint3 from, at;
from.Set(0, 5.f, 1.f);
at.Set(0, 20.f, 1.f);
up.Set(0,0.f,1.f);
hsMatrix44 cam;
cam.MakeCamera(&from,&at,&up);
hsMatrix44 id;
id.Reset();
pipe->SetWorldToCamera(cam, id); /* w2c, c2w */
Resulting matrix is (as represented in memory):
W2C: hsMatrix44[[1.0000, 0.0000, 0.0000, 0.0000]; [0.0000, 0.0000, 1.0000, -1.0000]; [0.0000, 1.0000, 0.0000, -5.0000]; [0.0000, 0.0000, 0.0000, 1.0000]]
#version 130
attribute vec3 position;
attribute vec4 color;
uniform mat4 matrix_l2w; /* This is always identity */
uniform mat4 matrix_w2c; /* See World-to-Camera above */
uniform mat4 matrix_proj; /* See Screen Projection above */
varying vec4 v_color;
void main() {
gl_Position = vec4(position, 1.0) * matrix_l2w * matrix_w2c * matrix_proj;
v_color = color;
}