WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 05-07-2009, 03:03 PM
cl113 cl113 is offline
Member
 
Join Date: May 2009
Posts: 1
Question displaying random scenes etc

i am a beginner and i am terrible at programming and am quite confused.

1. is there any way, after creating multiple scenes, that one can randomly select which scene to display using vizact.choice or something else?

2. does vizact.choice randomly choose from a list and then stop when all the list items have been chosen, or does it continue to choose from the list?

3. also, is there a specific command that allows you to reflect an object's position about a specific axis?

the online reference is not helping and any help would be much appreciated!!!!!!!!
Reply With Quote
  #2  
Old 05-10-2009, 05:14 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,453
You could randomly select a scene using the random module to generate a random integer and then set the scene to that number.
Code:
import viz
import random
viz.go()

#add three objects to three different scenes
duck = viz.add('duck.wrl',scene = 1)
wheelbarrow = viz.add('wheelbarrow.ive',scene=2)
wheelbarrow = viz.add('ball.wrl',scene=3)

viz.MainView.move(0,-1,-7)

def changeScene():
	num = random.randint(1,3)
	viz.scene(num)

vizact.ontimer(2, changeScene)
To get an objects position use
Code:
object.getPosition()
That will return a list with x,y,z position of the object.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Making buttons appear in scenes DBurks2818 Vizard 4 04-09-2009 02:25 PM
Arranging Scenes in Correct Order utepbereed Vizard 1 11-21-2008 09:19 AM
Random head movements VR_enthusiast Vizard 2 07-19-2006 11:59 AM
Random Seeds Vygreif Vizard 1 04-27-2006 09:21 PM
switching between scenes david Vizard 4 07-01-2003 06:05 PM


All times are GMT -7. The time now is 05:00 AM.


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