PDA

View Full Version : Linking objects to camera???


MrKangoo
March 3rd, 2005, 04:31 AM
Does anyone know how to link the models to the camera?
I am trying to make a HUD that stays attached to the view.
I thought it would be a fairly simple thing to do, however this is not the case... well not for me anyway!
Any help would be appreciated.

Mr Kangoo.

philip_lamb
March 4th, 2005, 02:15 AM
Any object you want to attach to the camera (like a HUD) should be drawn AFTER your projection transformation but BEFORE your view transformation. So if you take a look at the sourcecode for simpleLite (ARToolKit 2.70 and later) you would add the calls to draw your HUD after the call to arglCameraFrustum() and before the call to arglCameraView() (both in Display()).
There is code there that reads:
// Viewing transformation.
glLoadIdentity();
// Lighting and geometry that moves with the camera should go here.
// (I.e. must be specified before viewing transformations.)
//none
Put your code where the "//none" is.