WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 04-30-2007, 06:24 AM
shivanangel shivanangel is offline
Member
 
Join Date: Feb 2006
Location: New Jersey
Posts: 182
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
Reply With Quote
  #2  
Old 04-30-2007, 10:30 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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
Reply With Quote
  #3  
Old 04-30-2007, 02:34 PM
shivanangel shivanangel is offline
Member
 
Join Date: Feb 2006
Location: New Jersey
Posts: 182
Thank You!
Once again, something I should of known had I consulted the manual thoroughly.

Thanks again for the speedy reply.

~~George
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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