def __init__(self, rot=np.array([0.0, 0.0, 0.0]), scale=1.0, pos=np.array([0.0, 0.0, 0.0])):
        # Values to control camera
        self.rot = rot
        self.scale = scale
        self.pos = pos

        # TODO : users should have control over perspective frustrum
        self.stdmatrix = mth.perspective([0.0, 0.0, 0.25])
Example #2
0
    def __init__(
            self,
            rot=np.array([0.0, 0.0, 0.0]),
            scale=1.0,
            pos=np.array([0.0, 0.0, 0.0]),
    ):
        #Values to control camera
        self.rot = rot
        self.scale = scale
        self.pos = pos

        #TODO : users should have control over perspective frustrum
        self.stdmatrix = mth.perspective([0.0, 0.0, 0.25])
Example #3
0
    def get_matrix(self):
        r"""This will calculate the curent modelview matrix
	    from the camera's position, rotation, and zoom scale.  

        Parameters
        ----------
        dist   : float
            The amount of movement. **This unit is unknown!**
        """
        return mth.rotate_x(self.rot[0]) * mth.rotate_y(
            self.rot[1]) * mth.rotate_z(self.rot[2]) * mth.scale(
                (self.scale, self.scale, self.scale)) * mth.perspective(
                    [0.0, 0.0, 0.25]) * mth.translate(
                        (self.pos[0], self.pos[1], self.pos[2]))
    def get_matrix(self):
        r"""This will calculate the curent modelview matrix
	    from the camera's position, rotation, and zoom scale.  

        Parameters
        ----------
        dist   : float
            The amount of movement. **This unit is unknown!**
        """
        return (
            mth.rotate_x(self.rot[0])
            * mth.rotate_y(self.rot[1])
            * mth.rotate_z(self.rot[2])
            * mth.scale((self.scale, self.scale, self.scale))
            * mth.perspective([0.0, 0.0, 0.25])
            * mth.translate((self.pos[0], self.pos[1], self.pos[2]))
        )