WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   viz.lookat() with 3d text problem (https://forum.worldviz.com/showthread.php?t=1061)

shivanangel 04-30-2007 06:24 AM

viz.lookat() with 3d text problem
 
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:
Code:

self.tpressure.lookat(self.view.getPosition())
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.
Code:

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


All times are GMT -7. The time now is 01:02 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC