Skip to Main Content
3D Game Engine Design, 2nd Edition
book

3D Game Engine Design, 2nd Edition

by David Eberly
November 2006
Intermediate to advanced content levelIntermediate to advanced
1040 pages
26h 31m
English
CRC Press
Content preview from 3D Game Engine Design, 2nd Edition
142 Chapter 2 The Graphics System
glRotatef(fDegrees,kAxis.X(),kAxis.Y(),kAxis.Z());
float afOpenGLRotate[16];
glGetFloatv(GL_MODELVIEW_MATRIX,afOpenGLRotate);
The resulting rotation matrix is, of course, 4 × 4, but the upper-left 3 × 3 matrix is
the same one used by Wild Magic, as shown in Equation (2.22). For the sample code
here, the rotation matrix is
0.9966 0.0559 0.0593
0
0.0593 0.9966 0.0559
0
0.0559 0.0593 0.9966
0
0001
This is in the form in which you would multiply a vector by placing it on the right of
the matrix as a column vector.
A couple of items to be aware of. First, OpenGL’s
glRotate functions expect the
angle in degrees. Wild ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

3D Game Engine Architecture

3D Game Engine Architecture

David Eberly
Blender 3D By Example - Second Edition

Blender 3D By Example - Second Edition

Oscar Baechler, Xury Greer
Computer Graphics

Computer Graphics

Alexey Boreskov, Evgeniy Shikin

Publisher Resources

ISBN: 9781482267303