View Full Version : Clipping Plane
envisC
02-03-2010, 10:21 AM
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.
You can use window.clip or window.frustum to set the clipping plane.
envisC
02-03-2010, 12:00 PM
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.
farshizzo
02-03-2010, 12:47 PM
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):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)
envisC
02-09-2010, 12:31 PM
This is great! Thank you! Did I just miss this in the documentation?
pitbool
10-22-2012, 03:53 PM
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/commands/node3d/clipPlane.htm) but none worked.
Could farshizzo or anyone else please give any pointers to my problem?
Thanks in advance!
pitbool
10-22-2012, 04:13 PM
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.
pitbool
10-23-2012, 12:26 PM
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.
farshizzo
10-23-2012, 12:36 PM
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: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.
vBulletin® v3.8.7, Copyright ©2000-2025, vBulletin Solutions, Inc.