opengl.model: Add a lit and textured circle model.
This commit is contained in:
24
3-mid/opengl/source/lean/model/opengl-model-circle.adb
Normal file
24
3-mid/opengl/source/lean/model/opengl-model-circle.adb
Normal file
@@ -0,0 +1,24 @@
|
||||
package body openGL.Model.circle
|
||||
is
|
||||
|
||||
function vertex_Sites (Radius : in Real;
|
||||
Sides : in Positive := 24) return Vector_2_array
|
||||
is
|
||||
use linear_Algebra_2d;
|
||||
|
||||
the_Site : Vector_2 := [Radius, 0.0];
|
||||
Rotation : constant Matrix_2x2 := to_rotation_Matrix (to_Radians (360.0 / Degrees (Sides)));
|
||||
Result : Vector_2_array (1 .. Sides);
|
||||
|
||||
begin
|
||||
for i in Result'Range
|
||||
loop
|
||||
Result (i) := the_Site;
|
||||
the_Site := the_Site * Rotation;
|
||||
end loop;
|
||||
|
||||
return Result;
|
||||
end vertex_Sites;
|
||||
|
||||
|
||||
end openGL.Model.circle;
|
||||
Reference in New Issue
Block a user