WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 10-25-2008, 08:35 PM
znchb znchb is offline
Member
 
Join Date: Sep 2008
Posts: 21
How to wirte words on a BillBoard?

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.
Reply With Quote
  #2  
Old 10-26-2008, 05:32 PM
znchb znchb is offline
Member
 
Join Date: Sep 2008
Posts: 21
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.
Reply With Quote
  #3  
Old 10-26-2008, 06:36 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
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
  #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
  #5  
Old 10-26-2008, 09:27 PM
znchb znchb is offline
Member
 
Join Date: Sep 2008
Posts: 21
the attachment file

the scene file
Attached Files
File Type: zip billboard.zip (5.6 KB, 884 views)
Reply With Quote
  #6  
Old 10-27-2008, 09:50 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
You can make the text3d object a child of the billboard.

Code:
import viz

viz.go()

billboard = viz.add('billboard.3ds', pos = [0,0,5])

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

#press space bar to change message
vizact.onkeydown(' ', text.message, "new message")
Depending on what you want to do with this billboard it might be better to create textures with different text in them and swap the textures on the billboard

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.
Reply With Quote
  #7  
Old 10-30-2008, 12:26 AM
znchb znchb is offline
Member
 
Join Date: Sep 2008
Posts: 21
It works

Oh, it works. Thanks

you are genious!
Reply With Quote
  #8  
Old 11-02-2008, 07:00 AM
znchb znchb is offline
Member
 
Join Date: Sep 2008
Posts: 21
Wink 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.
# 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)
Reply With Quote
  #9  
Old 11-02-2008, 07:04 AM
znchb znchb is offline
Member
 
Join Date: Sep 2008
Posts: 21
sorry to make a mistake.
I suppose to post it as a new Question Topic.
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 04:07 PM.


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