WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 10-26-2008, 07:53 PM
znchb znchb is offline
Member
 
Join Date: Sep 2008
Posts: 21
how to use ***.remove() & how to show words directly? (change attach source code)

Attached is the source file I did. I need the Administrator's help for
how to use
***.remove()
and
how to show words directly on 'billboard2'? (in this program, I just use some picture instead the method to which I really want)
Attached Files
File Type: zip OneParameterEquation.zip (1.8 KB, 1908 views)
Reply With Quote
  #2  
Old 10-27-2008, 01:48 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
Sorry, I'm not sure I answered you question well in your other thread. If you want to add text to the billboard you can just create an image with text in it and apply it as a texture to the billboard just as you did with the picture. It would look something like this.

Code:
import viz

viz.go()

billboard = viz.add('billboard model')

message = viz.addTexture('message.jpg')
new_message = viz.addTexture('new_message.jpg')

billboard.texture(message)

vizact.onkeydown(' ', billboard.texture, new_message)
as far as your problem with the remove() method in your code it looks like you are creating a number of different apples but you are referring to them all as self.apple so when you go to use self.remove.apple() only the last one you added to the world disappears.
After you add an apple you could set its parent to be an empty group node. Then when you want to remove all the apples you can call group.remove() Here's a simple example of what I mean using some ducks that are all children of an empty group node.

Code:
import viz

viz.go()

group = viz.addGroup()

for i in range(5):
	
	duck =  viz.add('duck.cfg', pos = [i,0,5])
	duck.parent(group)

vizact.onkeydown(' ',group.remove)
let me know if this answers your questions.
Reply With Quote
  #3  
Old 10-30-2008, 12:33 AM
znchb znchb is offline
Member
 
Join Date: Sep 2008
Posts: 21
Smile thanks

Appreciate!

first, you give me a good mind of using 'text3D', it helps me a lot.

second, using group is a good idea. Thanks.

Besides, do you know how to use '.copy' method, if I use the 'copy' method, I just need add an apple, and make a copy to the other position, I think it will make the program run faster.
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 08:58 PM.


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