Nehe的opengl課程9:
glTranslatef(0.0f,0.0f,zoom); // Zoom Into The Screen (Using The Value In 'zoom')
glRotatef(tilt,1.0f,0.0f,0.0f); // Tilt The View (Using The Value In 'tilt')
glRotatef(star[loop].angle,0.0f,1.0f,0.0f); // Rotate To The Current Stars Angle
glTranslatef(star[loop].dist,0.0f,0.0f); // Move Forward On The X Plane
glRotatef(-star[loop].angle,0.0f,1.0f,0.0f); // Cancel The Current Stars Angle
glRotatef(-tilt,1.0f,0.0f,0.0f); // Cancel The Screen Tilt
為甚這幾行,會造成星星繞屏幕中心旋轉,看不懂為甚會有旋轉效果
glRotatef(tilt,1.0f,0.0f,0.0f); 是說繞著x軸旋轉tilt角度,是不是y軸和z軸選轉旋轉tilt角度?
glTranslatef(star[loop].dist,0.0f,0.0f); 是說x位移star[loop].dist距離,是整個座標系位移,還是物體物位移,座標系不動?
重點根本看不出來哪邊造成星星會繞屏幕中心旋轉