WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 09-11-2006, 02:50 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

1) The values should be in milliseconds.

2) In 2.53 the viz.intersect() command is pretty much your only option. You might be able to speed up the call by disabling collisions with objects that you are not interested in.
Code:
object.disable(viz.COLLISION)
Another thing you can do is create very low-res versions of your models. These low-res versions will represent the collision mesh of the high-res models. Then disable collisions on the high-res and disable rendering on the low-res. The viz.intersect() command performs the intersection on each triangle in your model, regardless of the collision shape you defined for it using the collide*() functions.

Vizard 3.0 allows you to use the underlying physics engine to perform intersection tests, which will be optimized for the collision shapes defined for each model. I just did a test with a simple scene, and performing 100 intersections per frame caused the update time to be 25 ms using viz.intersect() and 2.5 ms using the physics line intersect command.
Reply With Quote
  #2  
Old 09-11-2006, 02:54 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Quote:
Strange. I was putting the viewpoint inside of an avatar and using that avatar as the body to detect for collisions. I was doing the 180 line intersections because I was simulating a laser range finder which returns distances to objects in a plane. The laser was not inside the mesh of the avatar, but very close to its front. None of the 180 rays ever touched the body enclosing the viewpoint; however, if I make the avatar that the viewpoint is inside of not visible, then this fuction speeds up a bit by a factor of 2 (0.08 seconds). This is weird to me, but I can live with weirdness.
Disabling collisions with the avatar would give you the same result. See my previous post.

Even though the laser line was not inside the mesh of the avatar, it was inside its bounding box. When Vizard is performing intersection tests it will first check if the line intersects with an objects bounding box. If it does, it will proceed to check if the line intersects with each triangle.
Reply With Quote
  #3  
Old 09-11-2006, 03:16 PM
pbeeson pbeeson is offline
Member
 
Join Date: Aug 2006
Posts: 31
I am getting 80ms with just my "indoor" environment, which is pretty simple. Maybe I should try to separate the walls from the ceiling and floor and add them both to vizard since I never care about intersecting with the seiling or floor.

Last edited by pbeeson; 09-11-2006 at 03:31 PM.
Reply With Quote
  #4  
Old 09-11-2006, 07:22 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Unless your floor and ceiling contain a lot of triangles, it's probably not going to make much of a difference. But if you want to try it out, you don't need to create separate models for them. Simply specify the name of the floor/ceiling mesh when disabling collisions. Example:
Code:
room.disable(viz.COLLISION,'ceiling')
room.disable(viz.COLLISION,'floor')
Also, do these intersections tests need to be performed every frame? If not, you can offload the intersection tests onto a thread that performs them at a lower rate.
Reply With Quote
  #5  
Old 09-11-2006, 08:30 PM
pbeeson pbeeson is offline
Member
 
Join Date: Aug 2006
Posts: 31
I noticed in version 3 that viz.phys.intersectLine() is much faster than viz.intersect(), but viz.phys.intersectLine seems to have some problems:

1) It returns intersections for non-visible objects (object whose visibility is set to off), which is different that viz.intersect()

2) It ignores the viz.disable(viz.COLLISION) command. Is there a way to get it to ignore certain objects?
I can run viz.phys.intersectLine(begin,end,True) to get a list and then check object IDs, but I don't know if there is an easier way (especially considering that if you have many objects, it might be an optimzation to not check for intersections with particular objects at certain times, e.g. if you are casting rays from within an object).

3) As I said earlier, I am casting 180 "rays" from a virtual laser range finder. When I do this, viz.phys.intersectLine() is much faster than viz.intersect() (Even if I set the all flag to True), but viz.phys.intersectLine actually misses some intersections with the closest objects, while viz.intersect() does not. I'll post two picture to illustrate my point.

Last edited by pbeeson; 09-12-2006 at 07:20 AM.
Reply With Quote
  #6  
Old 09-12-2006, 02:42 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Quote:
Originally Posted by pbeeson
I noticed in version 3 that viz.phys.intersectLine() is much faster than viz.intersect(), but viz.phys.intersectLine seems to have some problems:

1) It returns intersections for non-visible objects (object whose visibility is set to off), which is different that viz.intersect()
I just fixed this. Setting an object to non-visible will automatically disable physics on it.

Quote:
Originally Posted by pbeeson
2) It ignores the viz.disable(viz.COLLISION) command. Is there a way to get it to ignore certain objects?
I can run viz.phys.intersectLine(begin,end,True) to get a list and then check object IDs, but I don't know if there is an easier way (especially considering that if you have many objects, it might be an optimzation to not check for intersections with particular objects at certain times, e.g. if you are casting rays from within an object).
I just modified the physics intersectLine/Node commands so that they ignore objects which have physics disabled on them. viz.COLLISION will still only pertain to the old viz.intersect() command.

I know this really doesn't help you now, but we will probably release an update within the next few days.
Reply With Quote
  #7  
Old 09-12-2006, 04:00 PM
pbeeson pbeeson is offline
Member
 
Join Date: Aug 2006
Posts: 31
Quote:
Originally Posted by farshizzo
I know this really doesn't help you now, but we will probably release an update within the next few days.
It doesn't help me even when I get the update. In 2.53, I could have a body that represented the "viewer". That body could be not visible, so that intersect() would not see it, but collidingwith() still did see it. But, I get by with calling phys.intersect(start,end,True) and then removing points that intersect the viewers own "body".
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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


All times are GMT -7. The time now is 12:33 AM.


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