WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Thread Tools Rate Thread Display Modes
Old 12-05-2018, 06:13 AM
Vishav Vishav is offline
Join Date: Jun 2017
Posts: 57
How to call same function 50 times and every time new value need to save?


My environment has an avatar.

Avatar randomly points to objects placed in left or right (target object) in one trial.

I have total 48 targets i.e. 48 trials having with two objects one target and one distractor.

I have fixed function for left and right pointing but every time any two only objects should ON from 48 objects.

How I can easily write concisely?
Reply With Quote
Old 12-05-2018, 09:44 PM
Jeff Jeff is offline
WorldViz Team Member
Join Date: Aug 2008
Posts: 2,471
Add all the targets to a list. For each trial use the random module to select two values between 1-48. Then turn on the visibility of the two targets in the list with matching indices.
Reply With Quote
Old 12-06-2018, 11:05 PM
Vishav Vishav is offline
Join Date: Jun 2017
Posts: 57
That is the issue. How to make list of all 50 objects with fixed position and how to call it by indices?
Reply With Quote
Old 12-07-2018, 01:56 AM
Vishav Vishav is offline
Join Date: Jun 2017
Posts: 57
For example I have 8 objects. My Code:
ob1=viz.add('D:\PhD\S_Study\Objects 3D\Radio.dae',pos=[-0.9,0.38,2.54],euler=[0,0,0],scale =(0.014,0.014,0.0045))
ob2=viz.add('D:\PhD\S_Study\Objects 3D\Helmet.dae',pos=[7.75,1.38,-5.3],euler=[0,0,0],scale =(0.9,0.9,0.9))
ob3=viz.add('D:\PhD\S_Study\Objects 3D\Thomas.dae',pos=[-0.4,0.55,2.2],euler=[0,0,0],scale =(0.015,0.0135,0.009))
ob4=viz.add('D:\PhD\S_Study\Objects 3D\Picture.dae',pos=[1.1,0.64,2.3],euler=[90,0,0],scale =(0.3,0.3,0.3))
ob5=viz.add('D:\PhD\S_Study\Objects 3D\Bottle.dae',pos=[0.9,0.5,2.2],euler=[0,0,0],scale =(1.7,1.7,1.7))
ob6=viz.add('D:\PhD\S_Study\Objects 3D\Laptop.dae',pos=[-0.25,0.4,2.82],euler=[0,0,0],scale =(0.0018,0.0018,0.0017))
ob7=viz.add('D:\PhD\S_Study\Objects 3D\Spoon.dae',pos=[-1.25,0.08,5.75],euler=[0,0,0],scale =(0.031,0.032,0.032))
ob8=viz.add('D:\PhD\S_Study\Objects 3D\Chain.dae',pos=[1.3,0.55,2.5],euler=[0,0,0],scale =(0.7,0.7,0.7))


I put all in list:

Now I want to ON two at a time (ob1 and ob2) (one target and one distractor)
For next trial I want ob3 and ob4 to be ON and so on....
Reply With Quote
Old 12-07-2018, 09:53 PM
Vishav Vishav is offline
Join Date: Jun 2017
Posts: 57
This is sorted...Thanks for valuable suggestions.
Reply With Quote

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 12:26 PM.

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