WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 07-09-2007, 10:05 PM
mjabon mjabon is offline
Member
 
Join Date: Jul 2007
Posts: 63
Problems with making multiple objects from one .wrl?

Hello. I am having problems when I use a for loop to create a bunch of objects from one wrl. I want them all to be draggable by the hd. This is what I write:

for i in range(0,num):
rnumx = random.random()
rnumz = random.random()
#print rnum
screw = viz.add(SCREW_FILE)
tex = viz.add(SCREW_TEXTURE)
screw.texture(tex)
screw.scale(scale,SCREW_LENGTH,scale)
screw.rotate(1,0,0,90)
screw.translate(0,0,0)
screw.translate(x + r*rnumx,y + rnumz,z)
allObjects.append(screw)
screws.append(screw)
screw.visible(1)
hd.add(screw)
screw.stiffness(1.0)

But I can only pick up the first one.
Reply With Quote
  #2  
Old 07-10-2007, 11:03 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

Are you getting any error messages? The code looks OK. Could you try reposting the code with the [code][/code] tags so that the formatting is preserved?
Reply With Quote
  #3  
Old 07-10-2007, 12:53 PM
mjabon mjabon is offline
Member
 
Join Date: Jul 2007
Posts: 63
Well, I've attached the whole py file so maybe you can see the problem. Basically what happens is I make 4 screws, and the haptic pen picks up one and drags it - no problem. Then I pick up another one. I drag it somewhere. Then I go to pick up a 4th screw, but when I click down on it the pen magically moves the 2nd screw, even though I'm nowhere near it. It gets stuck on that one scerw, and no matter where I click it will drag that screw. It is weird.
Attached Files
File Type: txt code.txt (9.3 KB, 668 views)
Reply With Quote
  #4  
Old 07-10-2007, 01:23 PM
mjabon mjabon is offline
Member
 
Join Date: Jul 2007
Posts: 63
actually, it seems to be working. I think the haptic pen is just a little picky
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 10:38 PM.


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