WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 01-15-2008, 10:35 AM
dan12345 dan12345 is offline
Member
 
Join Date: Jan 2008
Posts: 58
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
Reply With Quote
  #2  
Old 01-15-2008, 11:15 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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()
When you add a file, Vizard will first check if the path exists relative to the script directory. If it does not exist, then it will look for the file in the resource path.
Reply With Quote
Reply


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
A Little Programming Problem with MultiDimensional Arrays shivanangel Vizard 2 04-25-2007 01:21 PM
general question about <network>.send() shai Vizard 2 08-16-2005 04:04 PM


All times are GMT -7. The time now is 08:26 AM.


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