WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Real time collision and object navigation (https://forum.worldviz.com/showthread.php?t=4820)

sunil.nair 09-17-2013 10:39 AM

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?

Jeff 09-17-2013 12:46 PM

Is the car linked to the haptic device? Can you explain more about how it's being controlled?

sunil.nair 09-18-2013 02:12 PM

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.

Jeff 09-18-2013 02:45 PM

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.

sunil.nair 09-18-2013 02:55 PM

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.

Jeff 09-19-2013 10:04 AM

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.

sunil.nair 09-19-2013 03:35 PM

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.

sunil.nair 09-21-2013 03:25 AM

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

Jeff 09-23-2013 11:11 AM

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?

sunil.nair 09-30-2013 11:01 AM

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

Jeff 10-01-2013 12:38 PM

If the model exported from Maya loads in Vizard you should be able to add it to the haptic simulation using the .addNode(node) command.

We support the 3ds Max to OSG workflow and use Max internally. We don't have any documentation related to Maya.

sunil.nair 10-04-2013 08:10 PM

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?


All times are GMT -7. The time now is 03:18 PM.

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