PageRenderTime 6ms CodeModel.GetById 2ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 1class PYRAMID
 2
 3inherit
 4	GL_OBJECT
 5		redefine draw
 6		end
 7
 8creation
 9	make_with_position
10
11feature{ANY}
12	build is
13		do
14		end
15	
16	draw is
17		do
18			smart_gl.rotate(angle, 0, 1, 0)
19			smart_gl.begin_triangles
20			full_red.render
21			smart_gl.vertex(0, 1, 0)
22			full_green.render
23			smart_gl.vertex(-1, -1, 1)
24			full_blue.render
25			smart_gl.vertex(1, -1, 1)
26
27			full_red.render
28			smart_gl.vertex(0, 1, 0)
29			full_blue.render
30			smart_gl.vertex(1, -1, 1)
31			full_green.render
32			smart_gl.vertex(1, -1, -1)
33
34			full_red.render
35			smart_gl.vertex(0, 1, 0)
36			full_green.render
37			smart_gl.vertex(1, -1, -1)
38			full_blue.render
39			smart_gl.vertex(-1, -1, -1)
40
41			full_red.render
42			smart_gl.vertex(0, 1, 0)
43			full_blue.render
44			smart_gl.vertex(-1, -1, -1)
45			full_green.render
46			smart_gl.vertex(-1, -1, 1)
47			smart_gl.end_primitive
48		end
49		
50	anim (widget: GL_WIDGET): BOOLEAN is
51		do
52			angle := angle + 2
53			widget.display_gl
54			Result := True
55		end
56
57feature{}
58	angle: REAL
59
60end