From 33613a85afc4b1481367fbe92a17ee59c240250b Mon Sep 17 00:00:00 2001 From: Sven Eisenhauer Date: Fri, 10 Nov 2023 15:11:48 +0100 Subject: add new repo --- .../OpenGL_Kamera_turba_eisenhauer/main.cpp | 53 ++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 Bachelor/GDV2/Praktikum-OpenGL/OpenGL_Kamera_turba_eisenhauer/main.cpp (limited to 'Bachelor/GDV2/Praktikum-OpenGL/OpenGL_Kamera_turba_eisenhauer/main.cpp') diff --git a/Bachelor/GDV2/Praktikum-OpenGL/OpenGL_Kamera_turba_eisenhauer/main.cpp b/Bachelor/GDV2/Praktikum-OpenGL/OpenGL_Kamera_turba_eisenhauer/main.cpp new file mode 100644 index 0000000..b510d5e --- /dev/null +++ b/Bachelor/GDV2/Praktikum-OpenGL/OpenGL_Kamera_turba_eisenhauer/main.cpp @@ -0,0 +1,53 @@ +#include //GLUT .h-Datei, lädt auch GL .h-Dateien +#include "Wuerfel.h" +#include +#include +#include + +float fRotY=0; + +void Compute(void) +{ + fRotY+=20; + glutPostRedisplay(); + Sleep(500); +} + +void RenderScene(void) +{ + glClearColor(1.f, .5f, 0.f, 1.f); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); + //glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho( -2., 2., -2., 2., -2., 2.); + //glTranslatef(x , 0., -1.); + glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); + //glMatrixMode(GL_MODELVIEW); + //glLoadIdentity(); + gluLookAt(0., 0., 1., + 0., 0., 0., + 0, 1, 0.); + //glRotatef(fRotY, 0., 1., 0.); + glRotatef(-45,0.f,0.f,1.f); + glPushMatrix(); + glScalef(2.f,0.7f,0.7f); + Wuerfel(0.4); + glPopMatrix(); + glScalef(1.5f,0.3f,0.3f); + glTranslatef(0.8f,0.f,0.f); + Wuerfel(0.4); + //glFlush(); + glutSwapBuffers(); +} +int main(int argc, char **argv) +{ + glutInit( &argc, argv ); + glutInitDisplayMode( GLUT_DOUBLE| + GLUT_RGB|GLUT_DEPTH ); + glutCreateWindow("OpenGL Kamera"); + glutDisplayFunc( RenderScene ); + //glutIdleFunc(Compute); + glEnable(GL_DEPTH_TEST); + glutMainLoop(); +return 0; +} \ No newline at end of file -- cgit v1.2.3