java - old JOGL, order of transformation -
i have solve problem , realize bit oldschool code..
i need write down order of transformations 1 4 , result pruple vertex. me check whether correct , if not - why?
it bit tough me find answers , 100% sure correct.
what think correct: 1. start bottom, take modelview first, projection - yet not sure did right...
edit, code rewritten text:
gl.glmatrixmode(gl.gl_modelview); gl.glloadidentity(); gl.glmatrixmode(gl.gl_projection); gl.glloadidentity(); gl.glmatrixmode(gl.gl_modelview); gl.gltranslatef(-1, -1, -0); gl.glmatrixmode(gl.gl_projection); gl.glscalef(2, 1, 3); gl.glrotatef(-90, 0, 0, 1); gl.glmatrixmode(gl.gl_modelview); gl.glscalef(2, 3, 1); gl.glbegin(gl.gl_quads); gl.glcolor3f(0, 0, 1); gl.glvertex3f(-2, -2, -2); gl.glcolor3f(1, 1, 0); gl.glvertex3f(2, 1, 3); gl.glcolor3f(1, 0, 1); gl.glvertex3f(1, 1, -2); gl.glcolor3f(0, 1, 0); gl.glvertex3f(-1, 1, 2); gl.glend();
write transformations go in order , write coordinate changes of purple vertex each transformation.
transform 1:________________ coordinates x:_______ y:_______ z: _______
transform 2:________________ coordinates x:_______ y:_______ z: _______
transform 3:________________ coordinates x:_______ y:_______ z: _______
transform 4:________________ coordinates x:_______ y:_______ z: _______
problem solved
- supposed start model transforms , projection, bottom
- apply transforms bottom
also, accidentally using wrong coordinates..
~thanks though!
Comments
Post a Comment