-
Notifications
You must be signed in to change notification settings - Fork 10
3D objects
This section contains the class Object and two related classes : Material and Mesh.
This class represents how the light behaves on the object in the Phong illumination, it contains the color of the object and 4 other variables : The first 3 (ambient, diffuse and specular) define the opacity of the 3 parts of the Phong illumination, and the last variable is the shininess that defines the size and the smoothness of the reflection. (more information on Wikipedia)
-
Constructors :
- You can specify the color and each parameter of the Phong illumination.
- You can also only give the color (in this case the object will not interact with light).
-
Functions :
- This class only contains getters and setters of the Phong parameters.
- This class only contains getters and setters of the Phong parameters.
This class represents a 3D model with all the data necessary for the correct display of the shape : positions, normals and texture coordinates.
-
Attributes :
-
Static variables :
-
circle_64(Mesh) : A circle with 64 edges. -
empty_circle_64(Mesh) : An empty circle with 64 edges. -
cone_64(Mesh) : A cone with 64 latitudes. -
cube(Mesh) : A cube. -
empty_cube(Mesh) : An empty cube. -
cylinder_64(Mesh) : A cylinder with 64 latitudes. -
null(Mesh) : An empty mesh. -
sphere_64(Mesh) : A sphere with 64 latitudes and longitudes. -
square(Mesh) : A square. -
empty_square(Mesh) : An empty square. -
screen(Mesh) : A shape that takes all the screen for post processing shaders.
-
-
Functions :
- Functions giving the size of each part of the mesh (useful for OpenGL functions).
- A
clearfunction that empty the mesh. - Static functions working as constructors for the default shapes (spheres, cones, cylinders...).
-
Operators :
- The
+operator allows you to merge two meshes. - The
*operator allows you to apply a matrix to a mesh.
- The
This class represents a 3D object, it can be binded for optimization but it is not essential.
-
Attributes :
-
Constructors :
- You can specify the mesh and the material of the object.
-
Functions :
- You can use
bindandunbindfor optimization but it is not essential. - The
createfunction is usefull to initialize an already constructed object. - You can change the shader (initially it is the default shader).
- You can add a texture to the object.
- The
set_meshfunction allows to change the mesh and update it directly. - You can get and set the position, the size, the rotation and the thickness of the borders of the object.
- You can use