#1
|
|||
|
|||
General question and question regarding arrays
Hello -
I started working now in a psychology department which purchased worldviz, thus i am a newbie - so i will probably be harrassing this forum alot. My first question, is whether this forum is indeed the place i should go to to ask technical questions (such as the following question) regarding the program - or should I maybe contact the support email? This forum is run by the worldviz team too, right? and the second question is small, but functions as an excuse for the post - i read in the tutorial that i can write something like object = viz.add('file location') and then manipulate object. if i want to create an array of objects, in which arr(i) will hold an object seperately for later manipulation, how do i do it? i can create the for loop to create the objects, but i don't know how to store them outside the loop... hope i was clear enough. and if i'm already at it - when i add from a file location, how can i specify exactly where the file is at, assuming it's not in the resources folder? and if i'm already already at it - just to get a feel who reads this forum and uses the program, it would be nice if anyone who reads this will just reply with general details about himself - i .e . for what needs he is using the program, for how long, is he satisfied with it.... thanks, dan |
#2
|
|||
|
|||
Here is a sample script that shows how to create an array of objects:
Code:
import viz viz.go() #Example code for creating arrays balls = [] for x in range(10): #Create a ball and set its position ball = viz.add('ball.wrl') ball.setPosition(0,0,x) #Append ball object to array balls.append(ball) #Example code for using arrays print balls print len(balls) for b in balls: print b.getPosition() |
Thread Tools | |
Display Modes | Rate This Thread |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
A Little Programming Problem with MultiDimensional Arrays | shivanangel | Vizard | 2 | 04-25-2007 12:21 PM |
general question about <network>.send() | shai | Vizard | 2 | 08-16-2005 03:04 PM |