0
擁有位於3D立方體的相機內display
相對攝像機移動到尋找方向:在gluLookAt
public void display(GLAutoDrawable drawable) {
...
glu.gluLookAt(eyeX, eyeY, eyeZ, centerX, centerY, centerZ, upX, upY, upZ);
...
}
相機看點 - (centerX, centerY, centerZ)
。
我想移動它相對於它的方向(向前,向後,向右,向左)。
根據center
(對於上面的每個面),我應該在eye
和center
上做什麼操作?
編輯:
我不需要實施,只是概念。
謝謝,你能描述一下'center'和'eye'的操作嗎? – URL87
看一下Move_Camera(浮點速度)方法(你必須知道vVector是相機位置和它看的地方之間的距離)。如果你想從基礎知識中學習,我會建議你這個http:// www。 morrowland.com/apron/tut_gl.php和這個http://nehe.gamedev.net/tutorial/loading_and_moving_through_a_3d_world/22003/(它的C++但很容易翻譯) – Nicola