WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 02-03-2010, 11:21 AM
envisC envisC is offline
Member
 
Join Date: Apr 2009
Posts: 9
Clipping Plane

Is there a way to create a clipping plane that I can manipulate? We want to be able to interactively create cross sections of our models.
Reply With Quote
  #2  
Old 02-03-2010, 12:10 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,458
You can use window.clip or window.frustum to set the clipping plane.
Reply With Quote
  #3  
Old 02-03-2010, 01:00 PM
envisC envisC is offline
Member
 
Join Date: Apr 2009
Posts: 9
We explored these options, but they don't provide the functionality that we need. What we really want is something similar to glClipPlane or osg::ClipNode, not just near and far clip planes for the camera.
Reply With Quote
  #4  
Old 02-03-2010, 01:47 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Here is a sample script that shows how to apply a custom clip plane on a model (Note: the clip plane values are specified in global coordinates):
Code:
import viz
import vizact
import vizmat
viz.go()

model = viz.add('gallery.ive',pos=(0,0,10))

model.clipPlane([1,0,0,-3])

slider = viz.addSlider(pos=(0.5,0.1,0))

def SetClip(p):
	model.clipPlane([1,0,0,vizmat.Interpolate(-3,3,p)])
vizact.onslider(slider,SetClip)
Reply With Quote
  #5  
Old 02-09-2010, 01:31 PM
envisC envisC is offline
Member
 
Join Date: Apr 2009
Posts: 9
This is great! Thank you! Did I just miss this in the documentation?
Reply With Quote
  #6  
Old 10-22-2012, 04:53 PM
pitbool pitbool is offline
Member
 
Join Date: Oct 2012
Posts: 31
Hi,

I have a list of around 5000 nodes on which I want to apply the clip operation.

I created a scenegraph with a parent node to all of these nodes. Then I created a clipplane to the parent node.
The clip plane works fine on the parent node. However the clipplane doesn't seem to apply to any of the children. I have tried with all the three op options (viz.OP_TRAVERSE, viz.OP_OVERRIDE, viz.OP_ROOT) in the clipplane definition (http://docs.worldviz.com/vizard/comm.../clipPlane.htm) but none worked.

Could farshizzo or anyone else please give any pointers to my problem?

Thanks in advance!
Reply With Quote
  #7  
Old 10-22-2012, 05:13 PM
pitbool pitbool is offline
Member
 
Join Date: Oct 2012
Posts: 31
Please let me add that when I said "I created a scenegraph with a parent node to all of these nodes", I meant I used the command <node3d>.setParent to set the parent of all the ~5000 nodes to one single node object.

Thanks.
Reply With Quote
  #8  
Old 10-23-2012, 01:26 PM
pitbool pitbool is offline
Member
 
Join Date: Oct 2012
Posts: 31
I have found a way to do this - by applying the clipPlane to every node of those ~5000 nodes. I was initially hesitant to try this out, due to the limited number of planes openGL has. But I found that multiple instances of node3d.clipPlane may map to the same clipping plane of openGL. So that solved my problem.
Reply With Quote
  #9  
Old 10-23-2012, 01:36 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
It's difficult to say what you are doing wrong without seeing any code. The following sample applies a clip plane to a root node and affects all children. It works for me in Vizard 3 and 4:
Code:
import viz
viz.go()

root = viz.addGroup()

for x in range(20):
	viz.add('logo.ive',pos=(0,0,x),parent=root)

root.clipPlane([1,0,0,0])

import vizcam
vizcam.PivotNavigate(distance=10)
Also, in the future please post questions in new threads.
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
Near and far clipping on infinite terrain vijaykiran Vizard 2 01-21-2011 05:59 AM
Does the automatic clipping plane calculation work? Joran Vizard 4 07-10-2009 11:35 AM
Plane faces main View jaylocco Vizard 2 07-05-2009 09:21 PM
I need help with the Far Clip Plane... k_iwan Vizard 3 03-13-2007 05:54 AM
Panning Textures across a plane. shivanangel Vizard 3 04-07-2006 09:45 AM


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


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