GlEnd() // End of drawing color-cube // Render a pyramid consists of 4 triangles GlBegin(GL_QUADS) // Begin drawing the color cube with 6 quads // Top face (y = 1.0f) // Define vertices in counter-clockwise (CCW) order with normal pointing out GlTranslatef(1.5f, 0.0f, -7.0f) // Move right and into the screen GlLoadIdentity() // Reset the model-view matrix GlMatrixMode(GL_MODELVIEW) // To operate on model-view matrix // Render a color-cube consisting of 6 quads with different colors ![]() GlClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) // Clear color and depth buffers NOTE:When use it to watch movies,the video player you use should supports 3D format. Whenever the window needs to be re-painted. Il permet des réglages spécifiques à chaque type de casque VR en fonction de: La distorsion des lentilles. Le système de QR codes pour casque passif a été instauré par Google au mois de mai 2015. Called back when the window first appears and The new codes are: GLfloat anglePyramid 0.0f // Rotational angle for pyramid NEW GLfloat angleCube 0.0f // Rotational angle for cube NEW int refreshMills 15 // refresh interval in milliseconds NEW We define two global variables to keep track of the current rotational angles of the cube and pyramid. Les principaux QR codes pour masques VR mobiles. GlHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST) // Nice perspective corrections GlShadeModel(GL_SMOOTH) // Enable smooth shading GlDepthFunc(GL_LEQUAL) // Set the type of depth-test GlEnable(GL_DEPTH_TEST) // Enable depth testing for z-culling GlClearDepth(1.0f) // Set background depth to farthest GlClearColor(0.0f, 0.0f, 0.0f, 1.0f) // Set background color to black and opaque #include // GLUT, include glu.h and gl.h /* Global variables */ The hallow pyramid is made up of 4 triangle, with different colors on each of the vertices. ![]() The cube is made of of 6 quads, each having different colors. This example is taken from Nehe OpenGL Tutorial Lesson # 5 ), which displays a 3D color-cube and a pyramid. Otherwise, read " Introduction to OpenGL with 2D Graphics". I assume that you have some knowledge of OpenGL.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |