Exemplo n.º 1
0
    def __init__(self,
                pVecPos,
                pRadius,
                pName="sphere", pMaterial=None):

        WorldObject.__init__( self, name=pName, pos=pVecPos )

        self._radius = pRadius
        self._mat = pMaterial
        pass
Exemplo n.º 2
0
    def __init__(
            self,
            pVecPos,
            pVecNormal,
            pName="plane",
            pMaterial=None
    ):
        """
        Initialize the Plane object with position, normal vector, name and material

        :param pVecPos: A vec3 for the position
        :param pVecNormal: A vec3 for the normal to the plan
        :param pName: Name string
        :param pMaterial: Material instance
        """

        WorldObject.__init__(self, name=pName, pos=pVecPos)

        self._normal = pVecNormal
        self._mat = pMaterial
Exemplo n.º 3
0
    def __init__(self,
                pVecPos,
                pUp,
                pDir,
                pName="camera"):

        WorldObject.__init__(self, name=pName, pos=pVecPos, visible=False)

        self._up = pUp
        self._dir = pDir
        self._right = self._up.cross( self._dir )

        self._viewplaneDist = 1.0
        self._viewplaneHeight = 0.375
        self._viewplaneWidth = 0.5

        self._vUpLeftCorner = ""
        self._vUpLeftCorner = self._pos \
                                + ( ( self._dir*self._viewplaneDist ) + ( self._up*(self._viewplaneHeight/2) ) ) \
                                - ( self._up.cross(self._dir) * (self._viewplaneWidth/2) ) \

        pass