|
|
@ -0,0 +1,41 @@ |
|
|
|
import numpy as np |
|
|
|
import pyglet |
|
|
|
from pyglet.window import Window |
|
|
|
from pyglet.gl import * |
|
|
|
|
|
|
|
from . import heightmap |
|
|
|
|
|
|
|
FOV = 65 |
|
|
|
|
|
|
|
class VapourWindow(Window): |
|
|
|
def __init__(self): |
|
|
|
super().__init__() |
|
|
|
|
|
|
|
self.heightmap = np.random.uniform(-10, 10, size=(10, 10)) |
|
|
|
|
|
|
|
self.gl_setup() |
|
|
|
|
|
|
|
def gl_setup(self): |
|
|
|
glClearColor(0, 0, 0, 0) |
|
|
|
glColor3f(0, 1, 0,) |
|
|
|
glEnable(GL_DEPTH_TEST) |
|
|
|
glEnable(GL_CULL_FACE) |
|
|
|
|
|
|
|
def on_draw(self): |
|
|
|
self.clear() |
|
|
|
glLoadIdentity() |
|
|
|
|
|
|
|
verts = self.vert_list() |
|
|
|
|
|
|
|
def vert_list(self): |
|
|
|
return [] |
|
|
|
|
|
|
|
def on_resize(self, w, h): |
|
|
|
aspect = w/h |
|
|
|
glViewport(0, 0, w, h) |
|
|
|
glMatrixMode(GL_PROJECTION) |
|
|
|
glLoadIdentity() |
|
|
|
# gluPerspective(FOV, aspect, .1, 1000.) |
|
|
|
glMatrixMode(GL_MODELVIEW) |
|
|
|
|
|
|
|
return pyglet.event.EVENT_HANDLED |