WorldViz User Forum

WorldViz User Forum (
-   Vizard (
-   -   Problems with making multiple objects from one .wrl? (

mjabon 07-09-2007 11:05 PM

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.translate(x + r*rnumx,y + rnumz,z)

But I can only pick up the first one.

farshizzo 07-10-2007 12:03 PM


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?

mjabon 07-10-2007 01:53 PM

1 Attachment(s)
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.

mjabon 07-10-2007 02:23 PM

actually, it seems to be working. I think the haptic pen is just a little picky

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

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