PDA

View Full Version : Looking 'through' objects


mape2k
05-06-2013, 07:35 AM
Hello all,

I am having an issue with objects in my vizard model word. Even though I set the collisionbuffer to 3m, I am able to look through some of the models when I am near them. This is most prominent with an outer wall that I have created to form a border around an arena.

I have attached 2 pictures to illustrate the problem.

My questions are: What is the best way to fix this? Create an invisible coating in 3ds Max around the objects? Or adjust settings in Vizard?
What is the difference between viz.collisionbuffer() and myViewport.collisionbuffer()? Is the first one for all objects in my Vizard environment and the second one only for my viewport?
I have noticed that in the model piazza.osgb from Vizard, this problem does not occur. How is it solved there?

Thanks for your help!

farshizzo
05-06-2013, 09:33 AM
This sounds like a clip plane issue. By default, Vizard will automatically compute the near/far clip planes based on the bounding box of the currently visible geometry. However, with very large bounding boxes, the resolution of the near clip plane will be reduced, causing the issues you are seeing.

To solve this, you can either try reducing the dimensions of your scene or manually specify the clip plane values. It look like you are using some kind of sky dome in your scene. If the size of that is very large then it could be causing the problems. The following code can be used to specify the near/far clip planes:
viz.clip(0.1,200)

mape2k
05-07-2013, 06:07 AM
Hello farshizzo,

indeed, my movement area is very big (and has to be so!) Your suggestion of manually adjusting the clip plane worked flawlessly. Thanks again for your quick help!

All the best,
Johannes

brunomartelli
07-20-2013, 08:32 AM
what is the default far clip plane? is there any way to just specify the near clip and leave far at default?

Jeff
07-22-2013, 04:13 PM
The default far clip plane is 10000. You can get the current value using <window>.getFarClip() and pass that to the viz.clip function.

brunomartelli
07-22-2013, 04:25 PM
great! thanks