View Single Post
  #1  
Old 02-26-2013, 02:48 PM
pswaney pswaney is offline
Member
 
Join Date: Feb 2013
Posts: 1
Create a clipping box

I was wondering if it is possible to create a clipping box, such that an object inside the box would appear fully, but if the object was scaled such that any part of it fell outside the box, that portion would be clipped.

I have tried to use multiple clipping planes, but when creating the box, I am only able to create clipping planes on three sides of the box, and never two parallel sides. If, for example, I try to create two clipping planes that would form the top and bottom of the box, the plane I create second supersedes the first. See the example below for this behavior. Any help would be greatly appreciated, thanks!

Code:
import viz
import vizshape
viz.go()

vizshape.addGrid(color=[0.2]*3)
viz.clearcolor(viz.GRAY)

sphere = vizshape.addSphere(radius=3)

sphere.clipPlane([1,0,0,-1],num=1)
sphere.clipPlane([1,0,0,1],num=2)

import vizcam
vizcam.PivotNavigate(center=[0,2,0],distance=10)
Reply With Quote