GRAFIKA KOMPUTER ~ M. Ali Fauzi
Drawing 3D Graphics
3D TRANSFORMATION
Transformation Pipeline Vertex Modelview Matrix Projection Perspective Division Viewport Transformation Object Coordinates Eye Clip Normalized device Window GL_MODELVIEW mode glTranslate() glRotate() glScale() glLoadMatrix() glMultMatrix() gluLookAt() GL_PROJECTION mode glOrtho() gluOrtho2D() glFrustum() gluPerspective() glViewport()
Matrix Modes ~ ModelView Matrix (GL_MODELVIEW) These concern model-related operations such as translation, rotation, and scaling, as well as viewing transformations.
THE TRANSFORMATION
Translation The path is represented by a vector, called the translation or shift vector. P' = P + T tx ty tz x’ y’ z’ x y z = + New Position Current Position Translation Vector
Translation Translasi 3D -> 4D Translasi 2D -> 3D Koordinat Asal Koordinat Homogen
Scaling The transformation using Scale Matrix P' = S • P New Position Current Position
Scaling In Homogeneous Coordinate : P' = S • P New Position Scale Matrix Current Position
Rotation For 2D : P' = R . P New Position Rotation Matrix Current Position
Rotation For 2D :
Rotation 2D Rotation about an arbitrary axis (Rotasi pada sembarang sumbu (Xr,Yr) dengan sudut Ө) :
Rotation 3D Rotation, Roll y z x
Rotation 3D Rotation, Yaw y z x
Rotation 3D Rotation, Pitch y z x
sumbu putar sembarang titik (Ax,Ay,Az) Rotation 3D Rotation about an arbitrary axis (Rotasi pada sembarang sumbu (Ax,Ay,Az) dengan sudut Ө) sumbu putar sembarang titik (Ax,Ay,Az) y x z
Shearing 3D Shearing-x Shearing-y
Shearing 3D Shearing-z