Skip to content

Commit

Permalink
Create edge_graphics.py
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Jul 30, 2024
1 parent b7bc5dc commit 7a58f91
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions core/aerospace/edge_graphics.py
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()

0 comments on commit 7a58f91

Please sign in to comment.