View Single Post
  #3  
Old 10-26-2008, 06:36 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,462
You can make a text3d object a child of a texture quad. Here, the text object is slighly offset the quad in the z direction so it can be seen clearly.
Press the spacebar to change the message

Code:
import viz

viz.go()

# Create surface to wrap the texture on
quad = viz.addTexQuad()
quad.setPosition([0, 1.5, 3]) #put quad in view

# Wrap white texture on quad
quad.texture(viz.WHITE) 

#create text object and make it a child of the texture quad
text = viz.addText( 'message', quad ) 
text.setScale(.1,.1,.1)
text.alignment(viz.TEXT_CENTER_CENTER)
text.color(viz.BLACK)
text.setPosition(0,0,-.01)

#press space bar to change message
vizact.onkeydown(' ', text.message, "new message")
Reply With Quote