View Single Post
  #2  
Old 04-18-2012, 09:50 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Here is an example that applies a clip plane to a model and updates it every frame so that the plane is relative to the current viewpoint. Let me know if this isn't what you were asking for.
Code:
import viz
viz.go()

viz.add('ball.wrl',pos=(0,1.5,2))
model = viz.add('gallery.ive')

import vizact

def UpdateClipPlane():

	mat = viz.MainView.getMatrix()
	mat.preEuler(0,0,90)

	p = viz.Plane()
	p.setQuat(mat.getQuat())
	p.setPos(mat.getPosition())
	model.clipPlane(p)

vizact.onupdate(viz.PRIORITY_LAST_UPDATE,UpdateClipPlane)
Reply With Quote