transformation - OpenGL convert coordinates of object to another coordinate system -
transformation - OpenGL convert coordinates of object to another coordinate system -
i have 2 spheres in different coordinate systems:
glmatrixmode( gl_modelview ); glloadmatrixf( m1 ); glutwiresphere(70, 15, 15); glloadmatrixf( m2 ); glutwiresphere(70, 15, 15);
i want find position of sphere 2 in coordinate scheme of first sphere. please help me it?
what have m1
transforming sphere 1 eye space, , m2
sphere 2, can utilize eye space mutual space allows relate position between two. transformthe vertices in object space of sphere object space of sphere 1, go mutual eye space using m2
, , object space of sphere 1 using inverse of m1
. in classic gl notation, give compound transformation matrix
t=inverse(m1)*m2
and point x
in sphere 2's object space transformed x'
in sphere 1's object space as
x'=t*x
opengl transformation
Comments
Post a Comment