reflect camera - clip plane - deprecated warning

hello !

i 'm trying to make a water plane, following the exemple of Demo nature :
( … emo+nature )

The system works, but i 've got a little problem:
it’s a deprecated warning on the : ‘ClipPlaneAttrib’
( :pgraph(warning): Using deprecated ClipPlaneAttrib interface. )
I’m now looking for the new way of doing this

can anyone help me ?

planeNode = PlaneNode( ‘reflectPlane’ )
planeNode.setPlane( self.reflectplane )

cfa = CullFaceAttrib.makeReverse( )
cpa = ClipPlaneAttrib.make( ClipPlaneAttrib.OAdd, planeNode ) = RenderState.make( cfa,cpa ) ).setInitialState( )


The correct way to make a clip plane these days is:

planeNP = NodePath(PlaneNode('reflectPlane', self.reflectPlane))



Sorry to wake up the old thread, but I can’t get the new method to work.
In my water class, I create the stuff like this:

self.Plane = Plane(Vec3(0, 0, 1), Point3(0, 0, self.NodePath.getZ()))
self.PlaneNode = self.NodePath.attachNewNode(PlaneNode("VWaterPlane", self.Plane))

Now, after setting up my water camera, I used to do it like this:

self.Camera.node().setInitialState(RenderState.make(CullFaceAttrib.makeReverse(), ClipPlaneAttrib.make(ClipPlaneAttrib.OAdd, self.PlaneNode)))

However, how to do this sort of stuff with the setClipPlane interface? I don’t want to put it on render, since all cameras will be affected then?

You can use:


But note that an easier way to set up attribs on a camera may be to use a temporary node (not render, but any old NodePath you create for this purpose), which allows you to use the standard NodePath interface for setting state:

np = NodePath('np')

This is particularly useful when you are setting lots of attributes on your camera.


Ah, thanks.