diff options
| author | Sven Eisenhauer <sven@sven-eisenhauer.net> | 2023-11-10 15:11:48 +0100 |
|---|---|---|
| committer | Sven Eisenhauer <sven@sven-eisenhauer.net> | 2023-11-10 15:11:48 +0100 |
| commit | 33613a85afc4b1481367fbe92a17ee59c240250b (patch) | |
| tree | 670b842326116b376b505ec2263878912fca97e2 /Bachelor/GDV2/Praktikum-OpenGL/OpenGL_Kamera_turba_eisenhauer/main.cpp | |
| download | Studium-master.tar.gz Studium-master.tar.bz2 | |
Diffstat (limited to 'Bachelor/GDV2/Praktikum-OpenGL/OpenGL_Kamera_turba_eisenhauer/main.cpp')
| -rw-r--r-- | Bachelor/GDV2/Praktikum-OpenGL/OpenGL_Kamera_turba_eisenhauer/main.cpp | 53 |
1 files changed, 53 insertions, 0 deletions
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 <GL/glut.h> //GLUT .h-Datei, lädt auch GL .h-Dateien
+#include "Wuerfel.h"
+#include <windows.h>
+#include <cmath>
+#include <iostream>
+
+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 |
