Primary Operations¶
- pyglut.translate(vertex, value_x, value_y, value_z)¶
Translate an vertice from the given offset in every axes directions.
Parameters: vertex – an object from type Vertex to translate. This will be the vertice to translate from his current position (value from X, Y and Z).
Parameters: - value_x – The translation value on the X axe.
- value_y – The translation value on the Y axe.
- value_z – The translation value on the Z axe.
The values from this 3 arguments will be added to the current position from the vertice vertex given as argument.
Returns: An object from type Vertex within the new position of the vertice.
- pyglut.scale(vertex, factor)¶
Scaling function.
For scaling an 3D object you must give all his vertices to this function.
And the center of the 3D object to scale must be linked to the origin.
So translate all vertices from your 3D object from the values between his center and the origin. You can retranslate it back after.
Parameters: - vertex – An object from type Vertex to scale.
- factor – The scaling factor.
If the scaling factor is littler than 1.0 the 3D object will be littler than the original, else greater.
Returns: An object from type Vertex within the new position of the vertice.
- pyglut.rotate_x(vertex, angle)¶
Rotate an vertice around the X axe and return the result position vertice.
Parameters: - vertex – An object from type Vertex to rotate.
- angle – The rotation angle in degress.
For rotate an 3D object around his own X axe you must give all his vertices to this function.
And the center of the 3D object to rotate must correspond to the origin.
So translate all vertices from your 3D object from the values between his center and the origin. You can retranslate it back after.
Returns: An object from type Vertex within the new position of the vertice.
- pyglut.rotate_y(vertex, angle)¶
Rotate an vertice around the Y axe and return the result position vertice.
Parameters: - vertex – An object from type Vertex to rotate.
- angle – The rotation angle in degress.
For rotate an 3D object around his own Y axe you must give all his vertices to this function.
And the center of the 3D object to rotate must correspond to the origin.
So translate all vertices from your 3D object from the values between his center and the origin. You can retranslate it back after.
Returns: An object from type Vertex within the new position of the vertice.
- pyglut.rotate_z(vertex, angle)¶
Rotate an vertice around the Z axe and return the result position vertice.
Parameters: - vertex – An object from type Vertex to rotate.
- angle – The rotation angle in degress.
For rotate an 3D object around his own Z axe you must give all his vertices to this function.
And the center of the 3D object to rotate must correspond to the origin.
So translate all vertices from your 3D object from the values between his center and the origin. You can retranslate it back after.
Returns: An object from type Vertex within the new position of the vertice.