#1
|
|||
|
|||
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. |
#2
|
|||
|
|||
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? |
#3
|
|||
|
|||
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.
|
#4
|
|||
|
|||
actually, it seems to be working. I think the haptic pen is just a little picky
|
Thread Tools | |
Display Modes | Rate This Thread |
|
|