|
#1
|
|||
|
|||
Real time collision and object navigation
Hello,
I have an object 'mini.osg' (a car) that I am controlling using a Haptic device. My car moves on a ground. When I add a cube to my scene, it does not move over the cylinder even after I set viz.collision(viz.ON). Instead, it just moves into the cylinder even after I set it collideMesh or collideBox. I want the car to move over the cube or cylinder that I am adding to my scene. How can I do it? |
#2
|
|||
|
|||
Is the car linked to the haptic device? Can you explain more about how it's being controlled?
|
#3
|
|||
|
|||
Yes, the car is linked to the haptic device. So, when I move my device the car moves on the ground. Now, in my scene, I have added a cylinder such that it appears as a bump on the ground. I want my car to move over the cylinder like a car moves over a bump. Instead, it passes through it.
I have set collision ON but still it doesn't collide. |
#4
|
|||
|
|||
The command viz.collision(viz.ON) is used to prevent the movement of the viewpoint through objects.
Is the cylinder part of the haptic simulation? If not, the car will follow after the haptic device through the cylinder because they are linked. If you want the car to move in a different way you can disable the link once the car reaches the cylinder and animate it going over. |
#5
|
|||
|
|||
No, but i want my car to be linked to the haptic device. i do not want to give an animation. i want to drive it using the haptic over the cylinder. This is how i add the cylinder.
cylinder=vizshape.addCylinder(height=2.5,radius=4, topRadius=None,bottomRadius=None,axis=vizshape.AXI S_X,slices=20,bottom=True,top=True) cylinder.visible(viz.OFF) cylinder.setPosition([4,0,0]) cylinder.setScale(1,.1,0.3) cylinder.collideMesh() cylinder.disable(viz.DYNAMICS) cylinder.visible(viz.ON) i sit possible to switch on collision for the car and drive it over the cylinder. |
#6
|
|||
|
|||
When two objects are linked, the destination object (car) will follow after the source (haptic device). If you want the car to follow a different path and go over the cylinder while the device goes through it, don't use a link. You can update the car's X,Z position every frame based on the device position and calculate its Y position based on the intersection of the car and cylinder at that point. To update the car's position every frame register a function with the vizact.onupdate command.
|
#7
|
|||
|
|||
Jeff, I understand your point of removing the link. But, I want my car to be linked to the haptic device while it is going over the cylinder. THis is what i meant when i said that i want to drive my car over the cylinder using the HAPTIC.
|
#8
|
|||
|
|||
hey, your reply matters a lot in the project that i am working on. Is there a way to take my car over the cylinder keeping it linked to the haptic device without animating it
|
#9
|
|||
|
|||
If the cylinder is part of the haptic simulation then the device and car should be forced to go over the cylinder. You might create just a position link between the device and car and manually rotate the car each frame as it goes over the cylinder for a better effect.
If the cylinder is not part of the haptic simulation then the device will go through the cylinder. In that case, since the car follows a different path, I don't see a reason for maintaining the link at that time. What haptic device are you using? |
#10
|
|||
|
|||
Hello
I am using sensible haptics. I also wanted to know that if I create a scene in maya software, can I import it in vizard such that my device undergoes collision with objects in maya. I have installed osg exporter but I am trying to figure out how to export maya scene using this exporter |
#11
|
|||
|
|||
If the model exported from Maya loads in Vizard you should be able to add it to the haptic simulation using the <device>.addNode(node) command.
We support the 3ds Max to OSG workflow and use Max internally. We don't have any documentation related to Maya. |
#12
|
|||
|
|||
thanks. Now, say I have an .obj file that I import in vizard. Can I get a car (mini.osg) to collide with the components present in that .obj file?
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Find collision point of line and arbitrary object | asdf | Vizard | 2 | 01-28-2013 11:04 AM |
Collision Exception | jassel41 | Vizard | 2 | 11-09-2010 06:08 PM |
linked object collision | pgagolf | Vizard | 1 | 04-19-2007 02:27 PM |
when collision mode is on, can i "turn it off" for an individual object? | Vdoug | Vizard | 1 | 09-22-2005 01:14 PM |
Collision Detection often too slow | Johannes | Vizard | 4 | 02-28-2005 12:11 PM |