/tutorial/vision/opengl/NeHe/lesson05/pyramid.e
http://github.com/tybor/Liberty · Specman e · 60 lines · 50 code · 10 blank · 0 comment · 0 complexity · 253f09c8316527794e0048d13c8c9301 MD5 · raw file
- class PYRAMID
- inherit
- GL_OBJECT
- redefine draw
- end
- creation
- make_with_position
- feature{ANY}
- build is
- do
- end
-
- draw is
- do
- smart_gl.rotate(angle, 0, 1, 0)
- smart_gl.begin_triangles
- full_red.render
- smart_gl.vertex(0, 1, 0)
- full_green.render
- smart_gl.vertex(-1, -1, 1)
- full_blue.render
- smart_gl.vertex(1, -1, 1)
- full_red.render
- smart_gl.vertex(0, 1, 0)
- full_blue.render
- smart_gl.vertex(1, -1, 1)
- full_green.render
- smart_gl.vertex(1, -1, -1)
- full_red.render
- smart_gl.vertex(0, 1, 0)
- full_green.render
- smart_gl.vertex(1, -1, -1)
- full_blue.render
- smart_gl.vertex(-1, -1, -1)
- full_red.render
- smart_gl.vertex(0, 1, 0)
- full_blue.render
- smart_gl.vertex(-1, -1, -1)
- full_green.render
- smart_gl.vertex(-1, -1, 1)
- smart_gl.end_primitive
- end
-
- anim (widget: GL_WIDGET): BOOLEAN is
- do
- angle := angle + 2
- widget.display_gl
- Result := True
- end
- feature{}
- angle: REAL
- end