Type of shapes
Module OgamlGraphics.Shape
Creation and manipulation of 2D shapes
Creates a convex polygon given a list of points. points is this list of points, origin is the origin of the polygon. All coordinates are taken with respect to the top-left corner of the shape.
Creates a rectangle. Its origin is positioned with respect to the top-left corner.
Creates a regular polygon with a given number of vertices. When this number is high, one can expect a circle.
Creates a line from
top
(zero by default) to tip
.
Draws a shape on a window using the given parameters.
See : OgamlGraphics.DrawParameter
See : OgamlGraphics.Window
parameters
defaults to DrawParameter.make ~depth_test:false ~blend_mode:DrawParameter.BlendMode.alpha
See : OgamlGraphics.DrawParameter
See : OgamlGraphics.Window
Sets the position of the origin in the window.
Sets the position of the origin with respect to the top-left corner of the shape.
Sets the angle of rotation of the shape.
Sets the scale of the shape.
Sets the thickness of the outline.
Sets the filling color of the shape.
Translates the shape by the given vector.
Rotates the shape by the given angle.
Scales the shape.
Returns the position of the origin in window coordinates.
Returns the position of the origin with respect to the first point of the shape.
Returns the angle of rotation of the shape.
Returns the scale of the shape.
Returns the thickness of the outline.
Returns the filling color of the shape.
Vertex array access
Outputs a shape to a vertex array source.
This outputs triangles with position and color attributes.
Use DrawMode.Triangles with this source.
This outputs triangles with position and color attributes.
Use DrawMode.Triangles with this source.
Outputs a shape to a vertex array source by mapping its vertices.
See
See
to_source
for more information.