Reorganized imports

This commit is contained in:
Thomas FORGIONE
2016-11-25 15:03:03 +01:00
parent c6537a8f8c
commit e953492280
4 changed files with 38 additions and 43 deletions

View File

@@ -3,10 +3,7 @@
from .geometry import Vector
import pygame
from OpenGL.GL import *
from OpenGL.GLU import *
import OpenGL.GL as gl
import math
class Controls:
@@ -26,7 +23,7 @@ class TrackBallControls(Controls):
self.theta = 0
def apply(self):
glRotatef(self.theta * 180 / math.pi, self.vertex.x, self.vertex.y, self.vertex.z)
gl.glRotatef(self.theta * 180 / math.pi, self.vertex.x, self.vertex.y, self.vertex.z)
def update(self, time = 10):

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python3
from math import sqrt
import math
class Vector:
def __init__(self, x = 0.0, y = 0.0, z = 0.0):
@@ -27,7 +27,7 @@ class Vector:
return self.x * self.x + self.y * self.y + self.z * self.z
def norm(self):
return sqrt(self.norm2())
return math.sqrt(self.norm2())
def normalize(self):
norm = self.norm()