How to wirte words on a BillBoard?
:confused:Hi, Is there any tutorial to show me how to wirte words on a BillBoard & the words can be changed.
such as, when we click the keyboard, it will be changed to some other words that we already prepared. |
attached picture; Attach words directly
I just know hot to attach a picture that contains words to a 'BillBoard' ,
Eg. self.billboard2 = viz.add('c:\\VirtualWorlds\\table\\billboard.3DS') self.slide = viz.add('c:\\VirtualWorlds\\table\\slide2.jpg')#.j pg contain words self.billboard2.texture(self.slide) but not show words on 'BillBoard' directly, Is there some one help me and give me an simple example for attaching words directly? Thanks a lot. |
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 |
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") |
the attachment file
1 Attachment(s)
the scene file
|
You can make the text3d object a child of the billboard.
Code:
import viz By the way, we recommend exporting 3ds models into Vizards native file format (.ive/.osg). It supports baked lighting and other advanced features. You can download the exporter for Max from our downloads page. |
It works
Oh, it works. Thanks
you are genious! |
How to use 'time function' to control the appearance of balls
# I want to show balls on the screen one by one, not all the balls appear immediately.
:confused:# could you please help me to use the time function to control it. Appreciate. import viz viz.go() OriginalBall = viz.add('ball.wrl') for x in [0, 0.2, 0.4, 0.6, 0.8]: ## nested loop for y in [0, 0.3, 0.6, 0.9]: ball = OriginalBall.copy() ##use the copy() to save cpu resource ball.translate(2+x, 2+y, 2) ball.setScale(0.02,0.02,0.02) |
sorry to make a mistake.
I suppose to post it as a new Question Topic. |
All times are GMT -7. The time now is 10:47 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC