View Single Post
  #4  
Old 10-26-2008, 09:13 PM
znchb znchb is offline
Member
 
Join Date: Sep 2008
Posts: 21
Whether we can do like this? see the & the attached files

#some problems exist. if I use quad = viz.addTexQuad(), then I can not add #the 'billboard' to the scene. how to figure out this? Appreciate

import viz

viz.go()

####### Create surface to wrap the texture on
#quad = viz.addTexQuad()
#quad.setPosition([0, 1.5, 3]) #put quad in view
#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")

#####Whether we can do like this: ???
main = viz.add('c:\\VirtualWorlds\\table\\poolTableScene. 3DS') # the main scene
billboard = main.getChild('billboards') # object, named 'billboards', component of 'poolTableScene.3DS'

#quad = billboard.addTexQuad()

quad.setPosition([0, 1.5, 3])

quad.texture(viz.WHITE)

text = viz.addText('message', quad)
text.setScale(0.2,0.2,0.2)
text.alignment(viz.TEXT_CENTER_CENTER)
text.color(viz.BLACK)
text.setPosition(0,0,-.01)

vizact.onkeydown(' ', text.message, "new message")
Reply With Quote