opengl - How do I convert a 2D transformation matrix (for homogeneous coordinates) into 3D in the z=0 plane? -
i have 3x3 transformation matrix 2d homogeneous coordinates:
a b c d e f g h
i'd pass opengl (using glmultmatrix
) in 2d application, opengl takes 4x4 matrices 3d homogeneous coordinates. i'd coordinates transformed 4x4 matrix end x
, y
same 3x3 matrix , z=0
.
i've tried work out. vector x, y, 1
i'd end transformed vector ax + + c, dx + ey + f, gx + hy + i
, means vector x, y, 0, 1
, i'd want end tranformed vector ax + + c, dx + ey + f, 0, ?
. 1 matrix (as far can tell):
a b 0 c d e 0 f 0 0 1 0 0 0 0 1
is correct? work? don't think matrix give result i'm looking for, don't quite understand should or shouldn't go in third , fourth rows (and fourth column).
if want z-coordinate 0
, have pass zero-row. also, include perspective part in last row:
a b 0 c d e 0 f 0 0 0 0 g h 0
Comments
Post a Comment