Added track ball controls

This commit is contained in:
Thomas FORGIONE
2016-11-22 17:17:37 +01:00
parent 7f8e68fe96
commit 1eedef65ee
2 changed files with 63 additions and 1 deletions
+9
View File
@@ -17,6 +17,12 @@ class Vertex:
def __add__(self, other):
return Vertex(self.x + other.x, self.y + other.y, self.z + other.z)
def __mul__(self, other):
return Vertex(self.x * other, self.y * other, self.z * other)
def __rmul__(self, other):
return self.__mul__(other)
def norm2(self):
return self.x * self.x + self.y * self.y + self.z * self.z
@@ -45,6 +51,9 @@ class Vertex:
def __str__(self):
return '(' + ", ".join([str(self.x), str(self.y), str(self.z)]) + ")"
def dot(self, other):
return self.x * other.x + self.y * other.y + self.z * other.z
Normal = Vertex
TexCoord = Vertex