PDA

View Full Version : viz.lookat() with 3d text problem


shivanangel
04-30-2007, 06:24 AM
Hi,
I am trying to have your 3Dtext always look at the camera.
But instead of facing the camera from the normal left to right,
the 3d text always orients to has its back to the camera.

Any idea how to fix this?

My code is nothing special,
just:

#Orient the Text toward the camera
def faceCamera(self):
self.tpressure.lookat(self.view.getPosition())


Thanks,
George

farshizzo
04-30-2007, 10:30 AM
Hi,

This is because the text is always facing towards its local -Z axis. You need to apply a 180 degree rotation after the lookat command:self.tpressure.lookat(self.view.getPositio n())
self.tpressure.setEuler(180,0,0,viz.REL_LOCAL)Also , instead of manually performing this code, you can use the billboard() command to have Vizard automatically do it for you.text = viz.addText('hello')
text.billboard(viz.BILLBOARD_VIEW) #Have text always face the user

shivanangel
04-30-2007, 02:34 PM
Thank You!
Once again, something I should of known had I consulted the manual thoroughly.

Thanks again for the speedy reply.

~~George