![]() |
|
|
|
#1
|
|||
|
|||
|
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)
|
|
#2
|
|||
|
|||
|
You are the man. This is absolutely perfect. Just what I was trying to do, except my attempt looks like a Rube Goldberg machine next to this solution. Thanks!
One last thing: Is there an easy way to offset the plane a little bit to the right? |
|
#3
|
|||
|
|||
|
Hmm, thought I could edit posts here. Anyway, I tried to offset the plane by preTrans-ing it right after the preEuler, but it doesn't seem to be working.
Edit: Nevermind, got it. PreTrans-ing before Pre-Eulering did the trick. Last edited by Salvar; 04-18-2012 at 12:41 PM. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Clipping Plane | envisC | Vizard | 8 | 10-23-2012 12:36 PM |
| Tiling a texture on a plane | FreakyT | Vizard | 2 | 04-27-2011 05:34 PM |
| Does the automatic clipping plane calculation work? | Joran | Vizard | 4 | 07-10-2009 10:35 AM |
| 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 |