Seeing a collision ray when using additional camera

My scene consists of 12 cards flat on a table and when you click one, it flips over and grows to almost full screen. Then the card fades out while a frame on 2drender fades in, and the frame contains a scene shot by another camera.

My problem is that my collision ray (which comes from the original camera to the mouse) that is used to click the cards is showing up in the frame on 2drender. I can see the line and it looks ugly =(

Any ideas to get rid of the line?

Here’s my code:

    def createViewport(self):
        # Create the left offscreen buffer
        self.leftBuffer ='left', 512, 512) 
        self.leftBuffer.setClearColor(VBase4(0, 0, 0, 0)) 

        # Create a card to view the buffer on render2d
        self.leftCard = CardMaker('scene') 
        self.leftCard.setFrame(-1, 1, -.75, .75) 
        self.leftCardNP = aspect2d.attachNewNode(self.leftCard.generate()) 

        # make the frame camera look at the scene
        base.camList[1].setPos(0, 0, 10) 

    # end createViewport

   # track the mouse and set the collision ray from the camera to the mouse 
    def trackMouse(self, task):
        if base.mouseWatcherNode.hasMouse():
            self.mousePos = base.mouseWatcherNode.getMouse()
            self.pickerRay.setFromLens(base.camNode, self.mousePos.getX(), self.mousePos.getY() )
        return Task.cont
    #end trackMouse

A CollisionNode (the thing that contains your pickerRay) is hidden by default. At some point, you must have done a on the NodePath referencing your CollisionNode. Either don’t do that, or hide it again with nodePath.hide().


You’re right, I found where I showed the collision node path. Thanks again david =)