2019/4/25 Week10
(1)期中考:OpenGL必備10函式
(2)複習:移動,旋轉,縮放
(3)T-R-T旋轉(改變旋轉軸)
(4)主題:glut
Transformation.exe 自轉vs公轉
glTranslatef(...)
glRotatef(...)

glRotatef(...)
glTranslatef(...)

T-R-T旋轉(改變旋轉軸)
(1)先打出基本茶壺程式碼
#include <GL/glut.h>
void display()
{
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
glutSolidTeapot(0.3);
glutSwapBuffers();
}
int main(int argc,char**argv)
{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_DOUBLE|GLUT_DEPTH);
glutCreateWindow("week TRT");
glutDisplayFunc(display);
glutMainLoop();
}
(2)要把Cone移到茶壺的嘴巴
沒有留言:
張貼留言