WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 09-17-2013, 11:39 AM
sunil.nair sunil.nair is offline
Member
 
Join Date: Aug 2013
Posts: 14
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?
Reply With Quote
  #2  
Old 09-17-2013, 01:46 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
Is the car linked to the haptic device? Can you explain more about how it's being controlled?
Reply With Quote
  #3  
Old 09-18-2013, 03:12 PM
sunil.nair sunil.nair is offline
Member
 
Join Date: Aug 2013
Posts: 14
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.
Reply With Quote
  #4  
Old 09-18-2013, 03:45 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
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.
Reply With Quote
  #5  
Old 09-18-2013, 03:55 PM
sunil.nair sunil.nair is offline
Member
 
Join Date: Aug 2013
Posts: 14
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.
Reply With Quote
  #6  
Old 09-19-2013, 11:04 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
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.
Reply With Quote
  #7  
Old 09-19-2013, 04:35 PM
sunil.nair sunil.nair is offline
Member
 
Join Date: Aug 2013
Posts: 14
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.
Reply With Quote
  #8  
Old 09-21-2013, 04:25 AM
sunil.nair sunil.nair is offline
Member
 
Join Date: Aug 2013
Posts: 14
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
Reply With Quote
  #9  
Old 09-23-2013, 12:11 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
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?
Reply With Quote
  #10  
Old 09-30-2013, 12:01 PM
sunil.nair sunil.nair is offline
Member
 
Join Date: Aug 2013
Posts: 14
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
Reply With Quote
  #11  
Old 10-01-2013, 01:38 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
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.
Reply With Quote
  #12  
Old 10-04-2013, 09:10 PM
sunil.nair sunil.nair is offline
Member
 
Join Date: Aug 2013
Posts: 14
Smile

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?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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


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


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