PDA

View Full Version : grabbing problems.....


giancamati
12-14-2006, 03:45 PM
Hello Everybody, due to many successes with Vizard.....I would like to thank the developers! THANK YOU!

AND NOW.....ANOTHER QUESTION FOR YOU! :)

I scaled my objects with a factor between 0.0 and 1.0. I used

nodes = viz.phys.intersectNode(curs3D)
if len(nodes) > 0:
grabLink = viz.grab( curs3D, nodes[0] )

to detect if my 3D cursor intersect anyone of the objtect I would like to grab. Now, before scaling all my objects with the new factor, grabbing works perfectly!. But after having scaled my objects (exspecially with spheres), it happens that sometimes grab fails. Could be a bug of the intersect algorithm or may be the floating point precition is not very good, or may be there is a way to set a sort of sensibility for the grabbing.

Thank you so much for your help.:)
Giancarlo

Gladsomebeast
12-14-2006, 03:52 PM
Check if you are scalling the objects before you are creating their physics shapes with the collide fucntions. You must create the physics shapes after you scale the objects.

giancamati
12-15-2006, 12:01 AM
These are the model with which grabbig looks a little different.
FATTORETRASLAY = 0.4
FATTORESCALA =0.2

palla1 = viz.add('3D/nuovo/palla1.wrl')
palla1.setScale(FATTORESCALA,FATTORESCALA,FATTORES CALA)
palla1.translate(0,FATTORETRASLAY,0)
palla1.collideMesh()

palla2 = viz.add('3D/nuovo/palla2.wrl')
palla2.setScale(FATTORESCALA,FATTORESCALA,FATTORES CALA)
palla2.translate(0,FATTORETRASLAY,0)
palla2.collideMesh()

Does this code fit with your previous suggestion?
Thank you.
Giancarlo

Gladsomebeast
12-15-2006, 08:59 AM
That looks good. Does it work?

giancamati
12-15-2006, 09:02 AM
Yes it works, but it happens sometime it miss the grab. So I should execute the grabbing operation again.
With object with a big scale, this problems never happenend.

Thank you.

Gladsomebeast
12-15-2006, 09:24 AM
Try highligting the object when it is grabable. That way you will know when you can grab stuff.