![]() |
|
#1
|
|||
|
|||
|
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.
|
|
#2
|
|||
|
|||
|
You can use window.clip or window.frustum to set the clipping plane.
|
|
#3
|
|||
|
|||
|
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.
|
|
#4
|
|||
|
|||
|
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)
|
|
#5
|
|||
|
|||
|
This is great! Thank you! Did I just miss this in the documentation?
|
|
#6
|
|||
|
|||
|
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! |
|
#7
|
|||
|
|||
|
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. |
|
#8
|
|||
|
|||
|
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.
|
|
#9
|
|||
|
|||
|
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)
|
![]() |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Near and far clipping on infinite terrain | vijaykiran | Vizard | 2 | 01-21-2011 04:59 AM |
| Does the automatic clipping plane calculation work? | Joran | Vizard | 4 | 07-10-2009 10:35 AM |
| Plane faces main View | jaylocco | Vizard | 2 | 07-05-2009 08:21 PM |
| I need help with the Far Clip Plane... | k_iwan | Vizard | 3 | 03-13-2007 04:54 AM |
| Panning Textures across a plane. | shivanangel | Vizard | 3 | 04-07-2006 08:45 AM |