javascript - WebGL display loaded model without matrix -
javascript - WebGL display loaded model without matrix -
i'm learning webgl. i've managed draw stuff , understood pipeline. now, every tutorial see explains matrices before loading mesh. while can most, think need concentrate on process of loading external geometry, maybe through json file. i've read opengl default displays things orthogonally, ask: possible display 3d mesh without kind of transformation?
now, every tutorial see explains matrices before loading mesh.
yes. because understanding transformations essential , will need work them. they're not hard understand , sooner wrap head around them, better. in case of opengl model-view transformation part it's rather simple:
the transformation matrix bunch of vectors (in columns) placed within "parent" coordinate system. first columns define how x, y , z axes of "embedded" coordinate scheme aligned within "parent", w column moves around. varying lengths of base of operations vectors can stretc, i.e. scale things.
that's it, there's nil more (in modelview) that. larn rules of matrix-matrix multiplication. matrix-vector multiplication special case of matrix-matrix multiplication.
the projection matrix little bit trickier, suggest don't bother much it, utilize glm, eigen::3d or linmath.h build matrix. best analogy projection matrix beingness "lens" of opengl, i.e. apply zoom (aka field of view), tilt , shift. place of "camera" defined through modelview.
is possible display 3d mesh without kind of transformation?
no. because mesh coordinates have transformed screen coordinates. identity transform possible, which, yes, looks dead on orthographic projection coordinate range [-1, 1] in either dimension mapped fill viewport.
javascript json opengl webgl
Comments
Post a Comment