Integration part 2

Integration part 2 - Other Affine Transformations s s...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
3 Other Affine Transformations notice that no shear function must specify all 16 values of transformation matrix for “custom” transformations OpenGL requires an array with the 16 elements specified like so: GLfloat S[16]; // a scale matrix S[0] = 3.0f; S[4] = 0.0f; S[8] = 0.0f; S[12] = 0.0f; S[1] = 0.0f; S[5] = 5.0f; S[9] = 0.0f; S[13] = 0.0f; S[2] = 0.0f; S[6] = 0.0f; S[10] = 7.0f; S[14] = 0.0f; S[3] = 0.0f; S[7] = 0.0f; S[11] = 0.0f; S[15] = 1.0f; ú ú ú ú û ù ê ê ê ê ë é 15 11 7 3 14 10 6 2 13 9 5 1 12 8 4 0 m m m m m m m m m m m m m m m m 4 Other Affine Transformations (cont) void glLoadMatrixf(const GLfloat* M); sets the 16 values of current transformation matrix to those in the array M glMatrixMode(GL_MODELVIEW); glLoadIdentity(); // tos = I glLoadMatrixf(S); // tos = I*S void glMultMatrixf(const GLfloat* M); postmultiplies current transformation by matrix defined by M remember: if current matrix is C then current matrix is replaced with C*M
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 5

Integration part 2 - Other Affine Transformations s s...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online