Class Polygone
The class Polygone represents a polygon of an object. A polygon is composed of multiples vertexes.
Alliun only draws polygons which have 3 or 4 vertexes. If you have more vertexes in you polygon, it will not be drawn.
Vertex Get_Vertex(int pos)
Parameters
| pos | The position of the vertex you want to get. It has to be between 0 and Nb_Vertex() |
Returns
Description
This function take a vertex from the polygon. The vertex returned is not a copy of the old vertex but a reference.
All modification to the returned Vertex will affect the vertex in the polygon where it comes from.
|
void Add_Vertex(float x, float y, float z)
Parameters
| x | The x component of the new vertex |
| y | The y component of the new vertex |
| z | The z component of the new vertex |
Returns
Description
|
This function add a vertex to the polygon. Alliun can only draw TRIANGLES and QUADS so make sure you never create polygones with more than
4 vertexes.
|
void Del_Vertex(int pos)
Parameters
| pos | The position of the polygone you want to delete. It has to be between 0 and Nb_Polygones() |
Returns
Description
|
This function deletes a vertex from the polygon.
|
int Nb_Vertex()
Parameters
Returns
| int | the number of vertexes inside the polygon. |
Description
|
This function returns the number of vertexes inside the polygon.
|
void Set_Image(string image)
Parameters
| image | The new image to draw on the polygon. It can be a local file or a http link |
Returns
Description
|
This function replace the current image of the polygone with a new one. The new one can be a local file or a link to a web image file.
|
void Set_Color(float r, float g, float b)
Parameters
| r | The red component of the new color |
| g | The green component of the new color |
| b | The blue component of the new color |
Returns
Description
|
This function replace the current color of the polygon.
|
void Set_Def_MapY()
Parameters
Returns
Description
|
This function compute a default mapping for the texture.
|