WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 03-04-2016, 06:41 AM
Novakin Novakin is offline
Member
 
Join Date: Dec 2015
Posts: 9
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?
Reply With Quote
  #2  
Old 03-07-2016, 12:43 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,466
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')
Reply With Quote
  #3  
Old 03-09-2016, 06:39 AM
Novakin Novakin is offline
Member
 
Join Date: Dec 2015
Posts: 9
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.
Reply With Quote
  #4  
Old 03-09-2016, 06:46 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,466
Try changing:

Code:
ball.drawOrder(10)
to:

Code:
ball.setTransparentDrawOrder()
That might help with the transparency issue.
Reply With Quote
  #5  
Old 03-10-2016, 12:51 AM
Novakin Novakin is offline
Member
 
Join Date: Dec 2015
Posts: 9
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!
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
frustum versus clip and fov michaelrepucci Vizard 2 08-28-2008 11:50 PM
clip with frustum problem Joran Vizard 1 10-20-2006 10:16 AM


All times are GMT -7. The time now is 08:39 AM.


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