indexing description: "[ A scene which displayes a pyramid with OpenGL ]" date: "$Date$" revision: "$Revision$" class FIRST_SCENE inherit EM_GL_SCENE GL_FUNCTIONS export {NONE} all end GLU_FUNCTIONS export {NONE} all end create make feature {NONE} -- Initialisation make is -- Initialise default values. do make_scene -- Initialise normalized speed for rotation of pyramid create speed speed.set_speed (100) ensure speed_not_void: speed /= Void end feature -- Access angle: DOUBLE -- Rotation angle in degrees speed: EM_NORMALIZED_SPEED -- Rotation speed for pyramid feature -- Drawing draw is -- Draw scene. do -- Move the pyramid into the screen and rotate it gl_translatef (0, 0, -9) gl_rotatef (angle, 0, 1, 0) gl_begin (Em_gl_triangles) -- Front gl_color3f(1, 0, 0) -- Red gl_vertex3d (0, 1, 0) gl_vertex3d (-1, -1, 1) gl_vertex3d (1, -1, 1) -- Right gl_color3f(0, 1, 0) -- Green gl_vertex3d (0, 1, 0) gl_vertex3d (1, -1, 1) gl_vertex3d (1, -1, -1) -- Back gl_color3f (0, 0, 1) -- Blue gl_vertex3d (0, 1, 0) gl_vertex3d (1, -1, -1) gl_vertex3d (-1, -1, -1) -- Left gl_color3f (1, 1, 0) -- Yellow gl_vertex3d (0, 1, 0) gl_vertex3d (-1, -1, -1) gl_vertex3d (-1, -1, 1) gl_end -- Increment the angle if angle < 360 then angle := angle + speed.get_delta else angle := 0 end end invariant speed_not_void: speed /= Void end