WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Force drawing of a node/model outside of clip / view frustum? (https://forum.worldviz.com/showthread.php?t=5655)

Novakin 03-04-2016 06:41 AM

Force drawing of a node/model outside of clip / view frustum?
 
I'm trying to always draw a specific model, regardless of the clip or view frustum setting.

For example, if the camera is at (0, 0, 0), my model is at (0, 0, 5) and the clip is set by calling viz.clip(10, 100), then the result is that my model doesn't get drawn. This is all fine and how it should be. But is there a way to force that specific model or node to always get drawn regardless of the clip setting?

Jeff 03-07-2016 12:43 AM

Perhaps the following code will be helpful. It seems to get a bit tricky when other nodes are partially clipped or are in line with the node that is always drawn:

Code:

import viz
viz.go()

viz.MainWindow.clip(10,1000)

ball = viz.addChild('beachball.osgb',pos=[0,1.8,4])
ball.disable(viz.ADJUST_AUTO_CLIP)
ball.disable(viz.DEPTH_TEST)
ball.drawOrder(10)

ball2 = ball.copy(pos=[0.5,1.8,4])
ball3 = ball.copy(pos=[-0.5,1.8,4])
ball4 = ball.copy(pos=[0,1.8,2])
ball5 = ball.copy(pos=[0,1.8,5])

piazza = viz.addChild('piazza.osgb')


Novakin 03-09-2016 06:39 AM

That code does indeed do what I'm looking for, but unfortunately it has a bad effect on the model causing it to show small transparent bits in some places. I'm guessing that's because of the disabling of viz.DEPTH_TEST.

Thanks for the reply, I'll try to work around it for now.

Jeff 03-09-2016 06:46 AM

Try changing:

Code:

ball.drawOrder(10)
to:

Code:

ball.setTransparentDrawOrder()
That might help with the transparency issue.

Novakin 03-10-2016 12:51 AM

I'll add a bit of background info. I'm trying to draw the default Vizard gloves (viz.add('glove.cfg') and viz.add('glove_left.cfg')) as my hands using the Razer Hydra. This works great when I set the clip range to something like (0.1, 1000). However, the world we're visualizing is BIG, and a clip range of (10, 100000) is what we're using if we're not using the Hydra (and not showing gloves) but just keyboard and mouse. (Note: can't use a clip range of something like (0.1, 100000), because then we get z-fighting).

So what I'm trying to achieve is use the same big clip range, but then force draw the gloves up close. The code above (in your first and second posts) almost works, but still shows some 'glitches' in the gloves when you're moving and turning them.

If you have any tips, I'm always interested!


All times are GMT -7. The time now is 07:02 PM.

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