matrix - webgl - model coordinates to screen coordinates -
im having issue calculating screen coordinates of vertex. not webgl issue, more of general 3d graphics issue.
the sequence of matrix transformations im using is:
result_vec4 = perspective_matrix * camera_matrix * model_matrix * vertex_coords_vec4
model_matrix being transformation of vertex in local coordinate system global scene coord system. understanding final result_vec4 in clip space? should in [-1,1] range. not im getting... result_vec4 ends containing standard values coords, not corresponding correct screen position of vertex.
does have ideas might issue here? thank thoughts.
to go in clip space need project result_vec4
on hyperplane w=1
using:
result_vec4 /= result_vec4.w
by applying perspective division result_vec4.xyz
in [-1,1].
Comments
Post a Comment