2016-11-25 13:56:37 +00:00
|
|
|
from .geometry import Vector
|
2016-11-25 10:53:35 +00:00
|
|
|
|
|
|
|
from OpenGL.GL import *
|
|
|
|
from OpenGL.GLU import *
|
|
|
|
|
|
|
|
|
|
|
|
class Camera:
|
|
|
|
def __init__(self, position = None, target = None, up = None):
|
2016-11-25 13:56:37 +00:00
|
|
|
self.position = Vector() if position is None else position
|
|
|
|
self.target = Vector() if target is None else target
|
|
|
|
self.up = Vector(0.0,1.0,0.0) if up is None else target
|
2016-11-25 10:53:35 +00:00
|
|
|
|
|
|
|
def look(self):
|
|
|
|
gluLookAt(
|
|
|
|
self.position.x, self.position.y, self.position.z,
|
|
|
|
self.target.x, self.target.y, self.target.z,
|
|
|
|
self.up.x, self.up.y, self.up.z)
|