Reorganized imports
This commit is contained in:
@@ -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):
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user