예제 #1
0
 def __init__(self, model, position, orientation, scale):
     self.model = model
     self.position = position
     self.orientation = orientation
     self.scale = scale      
     
     self.transform = Matrix44.translation_vec3(position) * Matrix44.scale(scale) * orientation
    def __init__(self, position, orientation, clipping_planes):
        self.position = position
        self.orientation = orientation
        self.clipping_planes = clipping_planes

        cameraTranlationMatrixInverse = Matrix44.translation_vec3(position).get_inverse_translation()
        cameraRotationInverse = orientation.get_inverse_rotation()
        self.matrix = cameraRotationInverse * cameraTranlationMatrixInverse
예제 #3
0
def renderScene(camera, instances):
    """
    """
    cameraTranlationMatrixInverse = Matrix44.translation_vec3(camera.position).get_inverse_translation()
    cameraRotationInverse = camera.orientation.get_inverse_rotation()

    cameraMatrix = cameraRotationInverse * cameraTranlationMatrixInverse

    for instance in instances:
        transform = cameraMatrix * instance.transform
        transformAndClip(camera.clipping_planes, instance, transform)
예제 #4
0
def renderScene(camera, instances):
    """
    """
    cameraTranlationMatrixInverse = Matrix44.translation_vec3(camera.position).get_inverse_translation()
    cameraRotationInverse = camera.orientation.get_inverse_rotation()

    cameraMatrix = cameraRotationInverse * cameraTranlationMatrixInverse

    for instance in instances:
        transform = cameraMatrix * instance.transform
        renderModel(instance.model, transform)