Search code examples
openglglutfreeglut

Fixing one part while other rotate with camera in OpenGL


Is it is possible to have a openGL window where one part is fixed and other rotate or traslate with the camera.

To be more clear. I want a control bases screen. I want the control(may be buttons generated in square form) to be fixed while the rest screen move with the camera. Can any one tell me if it is feasible?


Solution

  • To achieve this effect you need to first draw your 3D scene using a perspective projection and then switch to an orthographic projection and draw your 2D control elements. This process is then repeated each frame. The technique is outlined here.