Permalink
Browse files

Still, sphere coords are odd :/

  • Loading branch information...
1 parent 4fd02b4 commit 5799c6c734dd997e933adcb7201aa7ed69b7903f Fabián Heredia Montiel committed Apr 27, 2012
Showing with 6 additions and 5 deletions.
  1. +3 −5 Engine/__main__.py
  2. +3 −0 Engine/loaders/obj.py
View
@@ -10,7 +10,7 @@
##########
# PyOpenGL
-print "=== Cargando PyOpenGL ==="
+print "=== Cargando PyOpenGL y AL ==="
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
@@ -104,8 +104,6 @@ def init():
object.create("resources/models/skybox.obj", {"id": "skybox", "pos": [0, 0, 0, 000], "scale": 30})
object.create("resources/models/Pejuang_Final.obj", {"id": "player", "pos": [0, 0, 0, 100], "rot": [90,0,0]})
object.create("resources/models/Pejuang_Final.obj", {"pos": [randint(0,360), randint(0,360), randint(0,360), 100]})
- object.create("resources/models/Pejuang_Final.obj", {"pos": [randint(0,360), randint(0,360), randint(0,360), 100]})
- object.create("resources/models/Pejuang_Final.obj", {"pos": [randint(0,360), randint(0,360), randint(0,360), 100]})
# Control de flujo
global nRun, nTime, tick
@@ -133,7 +131,7 @@ def display():
# Camara posicionada sobre el personaje
pos = object.objects["player"].getCart()
- gluLookAt(pos[0]*1, pos[1]*2, pos[2]*2, pos[0], pos[1], pos[2], 0, 1, 0)
+ gluLookAt(pos[0]*3, pos[1]*3, pos[2]*3, pos[0], pos[1], pos[2], 0, 1, 0)
glLightfv(GL_LIGHT0, GL_POSITION, [pos[0]*3, pos[1]*3, pos[2]*3, 1])
glLightfv(GL_LIGHT0, GL_AMBIENT, [0, 0, 0, 0])
@@ -143,7 +141,7 @@ def display():
for i in object.objects: object.objects[i].draw()
# Escena
- glutSolidSphere(100,40, 40)
+ glutSolidSphere(100,20, 20)
# Pasar a pantalla
glutSwapBuffers()
View
@@ -117,3 +117,6 @@ def __init__(self, filename, swapyz=False):
def draw(self = None):
glCallList(self.gl_list)
+ def aabb():
+ try: self.aabb
+ except: self.aabb = [map(min, [i for i in self.vertices]), map(max, [i for i in self.vertices])]

0 comments on commit 5799c6c

Please sign in to comment.