-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import numpy as np | ||
from OpenGL.GL import * | ||
from OpenGL.GLU import * | ||
|
||
class EDGEGraphics: | ||
def __init__(self, width, height): | ||
self.width = width | ||
self.height = height | ||
|
||
def render(self, scene): | ||
# Render the 3D graphics scene | ||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) | ||
glMatrixMode(GL_PROJECTION) | ||
glLoadIdentity() | ||
gluPerspective(45, self.width / self.height, 0.1, 100) | ||
glMatrixMode(GL_MODELVIEW) | ||
glLoadIdentity() | ||
gluLookAt(0, 0, 5, 0, 0, 0, 0, 1, 0) | ||
scene.render() | ||
|
||
def run(self): | ||
# Run the graphics rendering loop | ||
while True: | ||
self.render(scene) | ||
glutSwapBuffers() | ||
|
||
# Example usage: | ||
edge_graphics = EDGEGraphics(width=800, height=600) | ||
scene = Scene() | ||
edge_graphics.run() |