Commit 4e40b06b authored by lode_leroy's avatar lode_leroy

added Simulation mode



git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@57 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 3b367f98
......@@ -13,7 +13,7 @@ from OpenGL.GL import *
model = TestModel()
zbuffer = ZBuffer(-5,+5,30, -5,+5,30, 1,5)
zbuffer = ZBuffer(-5,+5,150, -5,+5,150, 1,5)
#zbuffer.add_wave()
......@@ -21,7 +21,7 @@ zbuffer = ZBuffer(-5,+5,30, -5,+5,30, 1,5)
c = SphericalCutter(0.25)
p = Point(-5,-5,1)
p = Point(-5,-5,2)
c.moveto(p)
zbuffer.add_triangles(model.triangles())
......
......@@ -113,6 +113,9 @@ class CylindricalCutter(BaseCutter):
return (None,INFINITE)
return (cl,l)
def intersect_plane(self, direction, triangle):
return self.intersect_circle_plane(direction, triangle)
def intersect(self, direction, triangle):
(cl_t,d_t) = self.intersect_circle_triangle(direction, triangle)
d = INFINITE
......
......@@ -115,6 +115,9 @@ class SphericalCutter(BaseCutter):
return (None,INFINITE)
return (cl,l)
def intersect_point(self, direction, point):
return self.intersect_sphere_point(direction, point)
def intersect(self, direction, triangle):
(cl_t,d_t) = self.intersect_sphere_triangle(direction, triangle)
d = INFINITE
......
......@@ -12,6 +12,7 @@ GLUT_WHEEL_DOWN=Constant('GLUT_WHEEL_DOWN',4)
from pycam.Geometry.utils import *
_DrawCurrentSceneFunc = None
_KeyHandlerFunc = None
# Some api in the chain is translating the keystrokes to this octal string
# so instead of saying: ESCAPE = 27, we use the following.
......@@ -31,7 +32,8 @@ zdist = -8.0
texture_num = 2
object = 0
light = 0
light = 1
shade_model = GL_FLAT
polygon_mode = GL_FILL
width = 320
height = 200
......@@ -47,7 +49,8 @@ def InitGL(Width, Height): # We call this right after our OpenGL window is cr
glDepthFunc(GL_LESS) # The Type Of Depth Test To Do
glEnable(GL_DEPTH_TEST) # Enables Depth Testing
# glShadeModel(GL_SMOOTH) # Enables Smooth Color Shading
glShadeModel(GL_FLAT) # Enables Flat Color Shading
# glShadeModel(GL_FLAT) # Enables Flat Color Shading
glShadeModel(shade_model)
glMatrixMode(GL_PROJECTION)
glLoadIdentity() # Reset The Projection Matrix
......@@ -104,8 +107,10 @@ def DrawGLScene():
# The function called whenever a key is pressed
def keyPressed(key, x, y):
global light, polygon_mode
global light, polygon_mode, shade_model
global xrot, yrot, zrot
global _KeyHandlerFunc
key = string.upper(key)
if key == ESCAPE or key=='Q':
# If escape is pressed, kill everything.
......@@ -114,6 +119,10 @@ def keyPressed(key, x, y):
light = not light
elif key == '=':
print "rot=<%g,%g,%g>" % (xrot,yrot,zrot)
elif key == 'I':
xrot = 110
yrot = 180
zrot = 250
elif key == 'T': # top
xrot=0
yrot=0
......@@ -131,11 +140,19 @@ def keyPressed(key, x, y):
yrot=0
zrot=+90
elif key == 'M':
if shade_model == GL_SMOOTH:
shade_model = GL_FLAT
else:
shade_model = GL_SMOOTH
glShadeModel(shade_model)
elif key == 'P':
if polygon_mode == GL_FILL:
polygon_mode = GL_LINE
else:
polygon_mode = GL_FILL
glPolygonMode(GL_FRONT_AND_BACK, polygon_mode)
elif _KeyHandlerFunc:
_KeyHandlerFunc(key, x, y)
class mouseState:
button = None
......@@ -188,11 +205,15 @@ def mouseMoved(x, y):
mouseState.x=x
mouseState.y=y
def Visualization(title, drawScene=DrawGLScene, width=320, height=200):
global window, _DrawCurrentSceneFunc
def Visualization(title, drawScene=DrawGLScene, width=320, height=200, handleKey=None):
global window, _DrawCurrentSceneFunc, _KeyHandlerFunc
glutInit(sys.argv)
_DrawCurrentSceneFunc = drawScene
if handleKey:
_KeyHandlerFunc = handleKey
# Select type of Display mode:
# Double buffer
# RGBA color
......
import math
from pycam.Geometry.Point import Point
import ctypes
try:
from OpenGL.GL import *
except:
pass
EPSILON=1e-8
NUM_PER_CELL_X = 10
NUM_PER_CELL_Y = 10
NUM_CELL_X = 0
NUM_CELL_Y = 0
class ZBufferItem:
def __init__(self, z=0.0):
self.z = float(z)
self.changed = True
self.list = -1
class ZCellItem:
def __init__(self):
self.list = -1
self.array = None
class ZBuffer:
def __init__(self, minx, maxx, xres, miny, maxy, yres, minz, maxz):
global NUM_CELL_X, NUM_CELL_Y, NUM_PER_CELL_X, NUM_PER_CELL_Y
self.minx = float(minx)
self.maxx = float(maxx)
self.miny = float(miny)
self.maxy = float(maxy)
self.minz = float(minz)
self.maxz = float(maxz)
self.xres = int(xres)
self.yres = int(yres)
self.changed = True
NUM_CELL_X = self.xres / NUM_PER_CELL_X
NUM_CELL_Y = self.yres / NUM_PER_CELL_Y
self.x = [0.0] * self.xres
for i in range(0,self.xres):
self.x[i] = self.minx+(i * (self.maxx-self.minx)/self.xres)
self.y = [0.0] * self.yres
for i in range(0,self.yres):
self.y[i] = self.miny+(i * (self.maxy-self.miny)/self.yres)
self.buf = [ [] ] * self.yres
for y in range(0,self.yres):
self.buf[y] = [ None ] * self.xres
for x in range(0,self.xres):
self.buf[y][x] = ZBufferItem(self.minz)
self.list = [ [] ] * self.yres
for y in range(0,self.yres):
self.list[y] = [ None ] * self.xres
for x in range(0,self.xres):
self.list[y][x] = -1
self.cell = [ None ] * NUM_CELL_Y
for y in range(0,NUM_CELL_Y):
self.cell[y] = [ None ] * NUM_CELL_X
for x in range(0,NUM_CELL_X):
self.cell[y][x] = ZCellItem()
def add_wave(self, freq=8, damp=3.0):
self.changed = True
rmax = math.sqrt(self.y[0]*self.y[0]+self.x[0]*self.x[0])
for y in range(0,self.yres):
for x in range(0,self.xres):
r = math.sqrt(self.y[y]*self.y[y]+self.x[x]*self.x[x])
self.buf[y][x].z = 1+math.cos(r/rmax*r/rmax*math.pi*freq)/(1+damp*(r/rmax))
self.buf[y][x].changed = True
def add_triangles(self, triangles):
for t in triangles:
self.add_triangle(t)
def add_triangle(self, t):
minx = int((t.minx()-self.minx)/(self.maxx-self.minx)*self.xres)-1
maxx = int((t.maxx()-self.minx)/(self.maxx-self.minx)*self.xres)+1
miny = int((t.miny()-self.miny)/(self.maxy-self.miny)*self.yres)-1
maxy = int((t.maxy()-self.miny)/(self.maxy-self.miny)*self.yres)+2
if minx<0:
minx=0
if maxx>self.xres-1:
maxx = self.xres-1
if miny<0:
miny=0
if maxy>self.yres-1:
maxy = self.yres-1
for y in range(miny, maxy):
py = self.y[y]
for x in range(minx, maxx):
px = self.x[x]
v0x = t.p3.x-t.p1.x
v0y = t.p3.y-t.p1.y
v1x = t.p2.x-t.p1.x
v1y = t.p2.y-t.p1.y
v2x = px-t.p1.x
v2y = py-t.p1.y
dot00 = v0x*v0x + v0y*v0y
dot01 = v0x*v1x + v0y*v1y
dot02 = v0x*v2x + v0y*v2y
dot11 = v1x*v1x + v1y*v1y
dot12 = v1x*v2x + v1y*v2y
invDenom = 1 / (dot00 * dot11 - dot01 * dot01)
u = (dot11 * dot02 - dot01 * dot12) * invDenom
v = (dot00 * dot12 - dot01 * dot02) * invDenom
if (u >= -EPSILON) and (v >= -EPSILON) and (u + v <= 1-EPSILON):
v0z = t.p3.z-t.p1.z
v1z = t.p2.z-t.p1.z
pz = t.p1.z+v0z*u+v1z*v
if pz>self.buf[y][x].z:
self.buf[y][x].z = pz
self.buf[y+0][x+0].changed = True
self.buf[y+0][x+1].changed = True
self.buf[y+1][x+0].changed = True
self.buf[y+1][x+1].changed = True
self.changed = True
def add_cutter(self, c):
cx = c.location.x
cy = c.location.y
rsq = c.radiussq
minx = int((c.minx-self.minx)/(self.maxx-self.minx)*self.xres)-1
maxx = int((c.maxx-self.minx)/(self.maxx-self.minx)*self.xres)+1
miny = int((c.miny-self.miny)/(self.maxy-self.miny)*self.yres)-1
maxy = int((c.maxy-self.miny)/(self.maxy-self.miny)*self.yres)+1
if minx<0:
minx=0
if maxx<0:
maxx=0
if minx>self.xres-1:
minx = self.xres-1
if maxx>self.xres-1:
maxx = self.xres-1
if miny<0:
miny=0
if maxy<0:
maxy=0
if maxy>self.yres-1:
maxy = self.yres-1
if miny>self.yres-1:
miny = self.yres-1
p = Point(0,0,0)
zaxis = Point(0,0,-1)
for y in range(miny, maxy):
p.y = py = self.y[y]
for x in range(minx, maxx):
p.x = px = self.x[x]
if (px-cx)*(px-cx)+(py-cy)*(py-cy) <= rsq+EPSILON:
(cl,ccp,cp,l) = c.intersect_point(zaxis, p)
if ccp:
pz = l
if pz<self.buf[y][x].z:
self.buf[y][x].z = pz
self.buf[y+0][x+0].changed = True
self.buf[y+0][x+1].changed = True
self.buf[y+1][x+0].changed = True
self.buf[y+1][x+1].changed = True
self.changed = True
def to_OpenGL(self):
self.to_OpenGL_6()
self.changed = False
def normal(self, z0, z1, z2):
nx = 1.0/self.xres
ny = 1.0/self.yres
nz = 1.0/(self.maxz-self.minz)
return -ny*(z1-z0)*nz/nx,-nx*(z2-z1)*nz/ny,nx*ny/nz*100
# the naive way (quads)
def to_OpenGL_1(self):
glBegin(GL_QUADS)
for y in range(0,self.yres-1):
for x in range(0,self.xres-1):
n = self.normal(self.buf[y+0][x+0].z,self.buf[y+0][x+1].z,self.buf[y+1][x+0].z)
glNormal3f(n[0],n[1],n[2])
glVertex3f(self.x[x+0], self.y[y+0], self.buf[y+0][x+0].z)
glVertex3f(self.x[x+1], self.y[y+0], self.buf[y+0][x+1].z)
glVertex3f(self.x[x+1], self.y[y+1], self.buf[y+1][x+1].z)
glVertex3f(self.x[x+0], self.y[y+1], self.buf[y+1][x+0].z)
glEnd()
# use display lists (per quad)
def to_OpenGL_2(self):
dx = 1.0/self.xres
dy = 1.0/self.yres
dz = 1.0/(self.maxz-self.minz)
for y in range(0,self.yres-1):
for x in range(0,self.xres-1):
# print "z[%f][%f]=%f" % (self.y[y],self.x[x],self.buf[y][x])
if self.buf[y+0][x+0].changed or self.buf[y+0][x+1].changed or self.buf[y+1][x+0].changed or self.buf[y+1][x+1].changed:
if self.buf[y][x].list == -1:
self.buf[y][x].list = glGenLists(1)
glNewList(self.buf[y][x].list, GL_COMPILE)
glBegin(GL_QUADS)
n = self.normal(self.buf[y+0][x+0].z,self.buf[y+0][x+1].z,self.buf[y+1][x+0].z)
glNormal3f(n[0],n[1],n[2])
glVertex3f(self.x[x+0], self.y[y+0], self.buf[y+0][x+0].z)
glVertex3f(self.x[x+1], self.y[y+0], self.buf[y+0][x+1].z)
glVertex3f(self.x[x+1], self.y[y+1], self.buf[y+1][x+1].z)
glVertex3f(self.x[x+0], self.y[y+1], self.buf[y+1][x+0].z)
glEnd()
glEndList()
for y in range(0,self.yres-1):
for x in range(0,self.xres-1):
self.buf[y][x].changed = False
glCallList(self.buf[y][x].list)
# use display list per cell (cell = group of quads)
def to_OpenGL_3(self):
dy = self.yres/NUM_CELL_Y
dx = self.xres/NUM_CELL_X
for y in range(0,NUM_CELL_Y):
y0 = y*dy
y1 = y0 + dy + 1
if y1 > self.yres:
y1 = self.yres
for x in range(0,NUM_CELL_X):
x0 = x*dx
x1 = x0 + dx + 1
if x1 > self.xres:
x1 = self.xres
changed = False
if self.changed:
for yi in range(y0,y1):
for xi in range(x0,x1):
if self.buf[yi][xi].changed:
changed = True
break
if changed:
if self.list[y][x] == -1:
self.list[y][x] = glGenLists(1)
if False:
glNewList(self.list[y][x], GL_COMPILE)
for yi in range(y0,y1-1):
glBegin(GL_TRIANGLES)
for xi in range(x0,x1-1):
n = self.normal(self.buf[yi+0][xi+0].z,self.buf[yi+0][xi+1].z,self.buf[yi+1][xi+0].z)
glNormal3f(n[0],n[1],n[2])
glVertex3f(self.x[xi+0], self.y[yi+0], self.buf[yi+0][xi+0].z)
glVertex3f(self.x[xi+0], self.y[yi+1], self.buf[yi+1][xi+0].z)
glVertex3f(self.x[xi+1], self.y[yi+1], self.buf[yi+1][xi+1].z)
n = self.normal(self.buf[y+1][x+1].z,self.buf[y+0][x+1].z,self.buf[y+1][x+0].z)
glNormal3f(n[0],n[1],n[2])
glVertex3f(self.x[xi+0], self.y[yi+0], self.buf[yi+0][xi+0].z)
glVertex3f(self.x[xi+1], self.y[yi+1], self.buf[yi+1][xi+1].z)
glVertex3f(self.x[xi+1], self.y[yi+0], self.buf[yi+0][xi+1].z)
self.buf[yi][xi].changed = False
glEnd()
glEndList()
else:
glNewList(self.list[y][x], GL_COMPILE)
for yi in range(y0,y1-1):
glBegin(GL_QUADS)
for xi in range(x0,x1-1):
n = self.normal(self.buf[yi+0][xi+0].z,self.buf[yi+0][xi+1].z,self.buf[yi+1][xi+0].z)
glNormal3f(n[0],n[1],n[2])
glVertex3f(self.x[xi+0], self.y[yi+0], self.buf[yi+0][xi+0].z)
glVertex3f(self.x[xi+0], self.y[yi+1], self.buf[yi+1][xi+0].z)
glVertex3f(self.x[xi+1], self.y[yi+1], self.buf[yi+1][xi+1].z)
glVertex3f(self.x[xi+1], self.y[yi+0], self.buf[yi+0][xi+1].z)
self.buf[yi][xi].changed = False
glEnd()
glEndList()
glCallList(self.list[y][x])
# use display list with vertex buffers per cell (cell = group of quads)
def to_OpenGL_4(self):
num_cell_x = NUM_CELL_X
num_cell_y = NUM_CELL_Y
dy = self.yres/num_cell_y
if dy < 2:
num_cell_y = 1
dy = self.yres
dx = self.xres/num_cell_x
if dx < 2:
num_cell_x = 1
dx = self.xres
for y in range(0,num_cell_y):
y0 = y*dy
y1 = y0 + dy + 1
if y1 > self.yres:
y1 = self.yres
for x in range(0,num_cell_x):
x0 = x*dx
x1 = x0 + dx + 1
if x1 > self.xres:
x1 = self.xres
changed = False
if self.changed:
for yi in range(y0,y1):
for xi in range(x0,x1):
if self.buf[yi][xi].changed:
changed = True
break
if changed:
# print "cell[",y,"][",x,"]=",self.cell[y][x].list
if self.cell[y][x].list == -1:
self.cell[y][x].list = glGenLists(1)
self.cell[y][x].array = (ctypes.c_float*3*((y1-y0)*(x1-x0)*2))()
glEnableClientState(GL_VERTEX_ARRAY)
glVertexPointerf(self.cell[y][x].array)
glNewList(self.cell[y][x].list, GL_COMPILE)
idx = 0
for yi in range(y0,y1-1):
lineidx = idx
for xi in range(x0,x1):
self.buf[yi][xi].changed = False
self.buf[yi+1][xi].changed = False
self.cell[y][x].array[idx+0][0] = self.x[xi+0]
self.cell[y][x].array[idx+0][1] = self.y[yi+0]
self.cell[y][x].array[idx+0][2] = self.buf[yi+0][xi+0].z
self.cell[y][x].array[idx+1][0] = self.x[xi+0]
self.cell[y][x].array[idx+1][1] = self.y[yi+1]
self.cell[y][x].array[idx+1][2] = self.buf[yi+1][xi+0].z
idx += 2
glDrawArrays(GL_QUAD_STRIP, lineidx, idx-lineidx+1)
glEndList()
glCallList(self.cell[y][x].list)
# use display list with vertex and normal buffers per cell (cell = group of quads)
def to_OpenGL_5(self):
num_cell_x = NUM_CELL_X
num_cell_y = NUM_CELL_Y
dy = self.yres/num_cell_y
if dy < 2:
num_cell_y = 1
dy = self.yres
dx = self.xres/num_cell_x
if dx < 2:
num_cell_x = 1
dx = self.xres
glEnableClientState(GL_VERTEX_ARRAY)
glEnableClientState(GL_NORMAL_ARRAY)
for y in range(0,num_cell_y):
y0 = y*dy
y1 = y0 + dy + 1
if y1 > self.yres:
y1 = self.yres
for x in range(0,num_cell_x):
x0 = x*dx
x1 = x0 + dx + 1
if x1 > self.xres:
x1 = self.xres
changed = False
if self.changed:
for yi in range(y0,y1):
for xi in range(x0,x1):
if self.buf[yi][xi].changed:
changed = True
break
if changed:
# print "cell[",y,"][",x,"]=",self.cell[y][x].list
if self.cell[y][x].list == -1:
self.cell[y][x].list = glGenLists(1)
self.cell[y][x].vertex = (ctypes.c_float*3*((y1-y0)*(x1-x0)*4))()
self.cell[y][x].normal = (ctypes.c_float*3*((y1-y0)*(x1-x0)*4))()
glVertexPointerf(self.cell[y][x].vertex)
glNormalPointerf(self.cell[y][x].normal)
glNewList(self.cell[y][x].list, GL_COMPILE)
idx = 0
for yi in range(y0,y1-1):
lineidx = idx
for xi in range(x0,x1-1):
self.buf[yi][xi].changed = False
self.buf[yi+1][xi].changed = False
self.cell[y][x].vertex[idx+0][0] = self.x[xi+0]
self.cell[y][x].vertex[idx+0][1] = self.y[yi+0]
self.cell[y][x].vertex[idx+0][2] = self.buf[yi+0][xi+0].z
self.cell[y][x].vertex[idx+1][0] = self.x[xi+0]
self.cell[y][x].vertex[idx+1][1] = self.y[yi+1]
self.cell[y][x].vertex[idx+1][2] = self.buf[yi+1][xi+0].z
self.cell[y][x].vertex[idx+2][0] = self.x[xi+1]
self.cell[y][x].vertex[idx+2][1] = self.y[yi+1]
self.cell[y][x].vertex[idx+2][2] = self.buf[yi+1][xi+1].z
self.cell[y][x].vertex[idx+3][0] = self.x[xi+1]
self.cell[y][x].vertex[idx+3][1] = self.y[yi+0]
self.cell[y][x].vertex[idx+3][2] = self.buf[yi+0][xi+1].z
n = self.normal(self.buf[yi+0][xi+0].z,self.buf[yi+0][xi+1].z,self.buf[yi+1][xi+0].z)
self.cell[y][x].normal[idx+0][0] = n[0]
self.cell[y][x].normal[idx+0][1] = n[1]
self.cell[y][x].normal[idx+0][2] = n[2]
self.cell[y][x].normal[idx+1][0] = n[0]
self.cell[y][x].normal[idx+1][1] = n[1]
self.cell[y][x].normal[idx+1][2] = n[2]
self.cell[y][x].normal[idx+2][0] = n[0]
self.cell[y][x].normal[idx+2][1] = n[1]
self.cell[y][x].normal[idx+2][2] = n[2]
self.cell[y][x].normal[idx+3][0] = n[0]
self.cell[y][x].normal[idx+3][1] = n[1]
self.cell[y][x].normal[idx+3][2] = n[2]
idx += 4
glDrawArrays(GL_QUADS, lineidx, idx-lineidx+1)
glEndList()
glCallList(self.cell[y][x].list)
glDisableClientState(GL_VERTEX_ARRAY)
glDisableClientState(GL_NORMAL_ARRAY)
# use display list with vertex and normal and index buffers per cell (cell = group of quads)
def to_OpenGL_6(self):
num_cell_x = NUM_CELL_X
num_cell_y = NUM_CELL_Y
dy = self.yres/num_cell_y
if dy < 2:
num_cell_y = 1
dy = self.yres
dx = self.xres/num_cell_x
if dx < 2:
num_cell_x = 1
dx = self.xres
glEnableClientState(GL_INDEX_ARRAY)
glEnableClientState(GL_VERTEX_ARRAY)
glEnableClientState(GL_NORMAL_ARRAY)
for y in range(0,num_cell_y):
y0 = y*dy
y1 = y0 + dy + 1
if y1 > self.yres:
y1 = self.yres
for x in range(0,num_cell_x):
x0 = x*dx
x1 = x0 + dx + 1
if x1 > self.xres:
x1 = self.xres
changed = False
if self.changed:
for yi in range(y0,y1-1):
for xi in range(x0,x1-1):
if self.buf[yi][xi].changed:
changed = True
break
if changed:
#print "cell[",y,"][",x,"]=",self.cell[y][x].list
if self.cell[y][x].list == -1:
self.cell[y][x].list = glGenLists(1)
self.cell[y][x].vertex = (ctypes.c_float*3*((y1-y0)*(x1-x0)))()
self.cell[y][x].normal = (ctypes.c_float*3*((y1-y0)*(x1-x0)))()
self.cell[y][x].index = (ctypes.c_ushort*(4*(y1-y0-1)*(x1-x0-1)))()
glIndexPointers(self.cell[y][x].index)
glVertexPointerf(self.cell[y][x].vertex)
glNormalPointerf(self.cell[y][x].normal)
glNewList(self.cell[y][x].list, GL_COMPILE)
idx = 0
for yi in range(y0,y1):
for xi in range(x0,x1):
self.buf[yi][xi].changed = False
self.cell[y][x].vertex[idx][0] = self.x[xi]
self.cell[y][x].vertex[idx][1] = self.y[yi]
self.cell[y][x].vertex[idx][2] = self.buf[yi][xi].z
if xi==self.xres-1 or yi==self.yres-1:
n = self.normal(self.buf[yi-1][xi-1].z,self.buf[yi-1][xi].z,self.buf[yi][xi-1].z)
else:
n = self.normal(self.buf[yi][xi].z,self.buf[yi][xi+1].z,self.buf[yi+1][xi].z)
self.cell[y][x].normal[idx][0] = n[0]
self.cell[y][x].normal[idx][1] = n[1]
self.cell[y][x].normal[idx][2] = n[2]
idx += 1
idx = 0
for yi in range(y0,y1-1):
for xi in range(x0,x1-1):
self.cell[y][x].index[idx+0] = (yi-y0+0)*(x1-x0) + (xi-x0+0)
self.cell[y][x].index[idx+1] = (yi-y0+1)*(x1-x0) + (xi-x0+0)
self.cell[y][x].index[idx+2] = (yi-y0+1)*(x1-x0) + (xi-x0+1)
self.cell[y][x].index[idx+3] = (yi-y0+0)*(x1-x0) + (xi-x0+1)
idx += 4
glDrawElements(GL_QUADS, idx, GL_UNSIGNED_SHORT, self.cell[y][x].index)
glEndList()
glCallList(self.cell[y][x].list)
glDisableClientState(GL_VERTEX_ARRAY)
glDisableClientState(GL_NORMAL_ARRAY)
glDisableClientState(GL_INDEX_ARRAY)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment