From 9e5c2c607cbd59d661f30166b88171e704b1b9f2 Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 1 Mar 2005 19:59:21 +0000 Subject: [PATCH] spin the mirror around to face down the forward axis --- direct/src/showbase/MirrorDemo.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/direct/src/showbase/MirrorDemo.py b/direct/src/showbase/MirrorDemo.py index 6317c205ea..5ebe2eafe6 100755 --- a/direct/src/showbase/MirrorDemo.py +++ b/direct/src/showbase/MirrorDemo.py @@ -31,13 +31,13 @@ def setupMirror(name, width, height): # Create a polygon to be the visible representation of the mirror. cm = CardMaker('mirror') - cm.setFrame(-width / 2.0, width / 2.0, -height / 2.0, height / 2.0) + cm.setFrame(width / 2.0, -width / 2.0, -height / 2.0, height / 2.0) cm.setHasUvs(1) card = root.attachNewNode(cm.generate()) # Create a PlaneNode to represent the mirror's position, for # computing where the mirror's camera belongs each frame. - plane = Plane(Vec3(0, -1, 0), Point3(0, 0, 0)) + plane = Plane(Vec3(0, 1, 0), Point3(0, 0, 0)) planeNode = PlaneNode('mirrorPlane') planeNode.setPlane(plane) planeNP = root.attachNewNode(planeNode) @@ -61,15 +61,16 @@ def setupMirror(name, width, height): # Since the reflection matrix will reverse the vertex-winding # order of all the polygons in the world, we have to tell the # camera to reverse the direction of its face culling. We also - # tell it not to draw (to clip) anything behind the mirror plane. + # tell it not to draw (that is, to clip) anything behind the + # mirror plane. camera.setInitialState(RenderState.make( CullFaceAttrib.makeReverse(), ClipPlaneAttrib.make(ClipPlaneAttrib.OAdd, planeNode))) # Create a visible representation of the camera so we can see it. - cameraVis = loader.loadModel('camera.egg') - if not cameraVis.isEmpty(): - cameraVis.reparentTo(cameraNP) + #cameraVis = loader.loadModel('camera.egg') + #if not cameraVis.isEmpty(): + # cameraVis.reparentTo(cameraNP) # Spawn a task to keep that camera on the opposite side of the # mirror.