class documentation
class Triangle3D(engine.Triangle3D):
Represent a colored triangle used by the 3D renderer.
Methods
- get_center()
- Return the triangle center.
- is_facing_camera(
camera_pos) - Return whether the triangle faces a camera position.
- is_facing_camera(
- set_x1(
x1) - Set the first vertex X coordinate.
- set_x1(
- set_y1(
y1) - Set the first vertex Y coordinate.
- set_y1(
- set_z1(
z1) - Set the first vertex Z coordinate.
- set_z1(
- set_x2(
x2) - Set the second vertex X coordinate.
- set_x2(
- set_y2(
y2) - Set the second vertex Y coordinate.
- set_y2(
- set_z2(
z2) - Set the second vertex Z coordinate.
- set_z2(
- set_x3(
x3) - Set the third vertex X coordinate.
- set_x3(
- set_y3(
y3) - Set the third vertex Y coordinate.
- set_y3(
- set_z3(
z3) - Set the third vertex Z coordinate.
- set_z3(
- set_color(
color) - Set the triangle color.
- set_color(
- set_wireframe(
wireframe) - Set whether to render a wireframe with the triangle.
- set_wireframe(
- __del__()
- Release the native triangle resources.
| Parameters | |
| x1 | First vertex X coordinate. Defaults to 0.0. |
| y1 | First vertex Y coordinate. Defaults to 0.0. |
| z1 | First vertex Z coordinate. Defaults to 0.0. |
| x2 | Second vertex X coordinate. Defaults to 0.0. |
| y2 | Second vertex Y coordinate. Defaults to 0.0. |
| z2 | Second vertex Z coordinate. Defaults to 0.0. |
| x3 | Third vertex X coordinate. Defaults to 0.0. |
| y3 | Third vertex Y coordinate. Defaults to 0.0. |
| z3 | Third vertex Z coordinate. Defaults to 0.0. |
| color | Triangle color. Defaults to 0x0000. |
| wireframe | Whether to render a wireframe with the triangle. Defaults to False. |
| Method | __setattr__ |
Set a triangle attribute, routing to the matching setter. |
| Instance Variable | color |
Triangle color. Writable. |
| Instance Variable | wireframe |
Whether to render a wireframe with the triangle. Writable. |
| Instance Variable | x1 |
First vertex X coordinate. Writable. |
| Instance Variable | x2 |
Second vertex X coordinate. Writable. |
| Instance Variable | x3 |
Third vertex X coordinate. Writable. |
| Instance Variable | y1 |
First vertex Y coordinate. Writable. |
| Instance Variable | y2 |
Second vertex Y coordinate. Writable. |
| Instance Variable | y3 |
Third vertex Y coordinate. Writable. |
| Instance Variable | z1 |
First vertex Z coordinate. Writable. |
| Instance Variable | z2 |
Second vertex Z coordinate. Writable. |
| Instance Variable | z3 |
Third vertex Z coordinate. Writable. |