class documentation

class Triangle3D(engine.Triangle3D):

View In Hierarchy

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.
  • set_x1(x1)
    Set the first vertex X coordinate.
  • set_y1(y1)
    Set the first vertex Y coordinate.
  • set_z1(z1)
    Set the first vertex Z coordinate.
  • set_x2(x2)
    Set the second vertex X coordinate.
  • set_y2(y2)
    Set the second vertex Y coordinate.
  • set_z2(z2)
    Set the second vertex Z coordinate.
  • set_x3(x3)
    Set the third vertex X coordinate.
  • set_y3(y3)
    Set the third vertex Y coordinate.
  • set_z3(z3)
    Set the third vertex Z coordinate.
  • set_color(color)
    Set the triangle color.
  • set_wireframe(wireframe)
    Set whether to render a wireframe with the triangle.
  • __del__()
    Release the native triangle resources.
Parameters
x1First vertex X coordinate. Defaults to 0.0.
y1First vertex Y coordinate. Defaults to 0.0.
z1First vertex Z coordinate. Defaults to 0.0.
x2Second vertex X coordinate. Defaults to 0.0.
y2Second vertex Y coordinate. Defaults to 0.0.
z2Second vertex Z coordinate. Defaults to 0.0.
x3Third vertex X coordinate. Defaults to 0.0.
y3Third vertex Y coordinate. Defaults to 0.0.
z3Third vertex Z coordinate. Defaults to 0.0.
colorTriangle color. Defaults to 0x0000.
wireframeWhether 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.
def __setattr__(self, name, value):

Set a triangle attribute, routing to the matching setter.

Parameters
name:strAttribute name to set.
value:objectNew value for the attribute.
color: int =

Triangle color. Writable.

wireframe: bool =

Whether to render a wireframe with the triangle. Writable.

x1: float =

First vertex X coordinate. Writable.

x2: float =

Second vertex X coordinate. Writable.

x3: float =

Third vertex X coordinate. Writable.

y1: float =

First vertex Y coordinate. Writable.

y2: float =

Second vertex Y coordinate. Writable.

y3: float =

Third vertex Y coordinate. Writable.

z1: float =

First vertex Z coordinate. Writable.

z2: float =

Second vertex Z coordinate. Writable.

z3: float =

Third vertex Z coordinate. Writable.