struct PF::Tri
- PF::Tri
- Struct
- Value
- Object
Defined in:
3d/tri.crConstructors
- .new(p1x : Float64, p1y : Float64, p1z : Float64, p2x : Float64, p2y : Float64, p2z : Float64, p3x : Float64, p3y : Float64, p3z : Float64, color : PF::Pixel = PF::Pixel.white)
- .new(p1 : Vector3(Float64), p2 : Vector3(Float64), p3 : Vector3(Float64), color : PF::Pixel = PF::Pixel.white, normal : PF::Vector3(Float64) | Nil = nil)
Instance Method Summary
-
#*(mat : Matrix)
Multiply all points by a Matrix, returning a new Tri
-
#clip(plane : Vector3, plane_normal : Vector3)
Split the triangle based on which points are inside of a given plane Returns a tuple of 0-2 triangles
- #color : PF::Pixel
- #color=(color : PF::Pixel)
-
#normal
Return the normal assuming clockwise pointing winding
- #normal=(normal : Vector3(Float64) | Nil)
- #p1 : Vector3(Float64)
- #p1=(p1 : Vector3(Float64))
- #p2 : Vector3(Float64)
- #p2=(p2 : Vector3(Float64))
- #p3 : Vector3(Float64)
- #p3=(p3 : Vector3(Float64))
-
#x
Get the average x value
-
#y
Get the average y value
-
#z
Get the average z value
Constructor Detail
def self.new(p1x : Float64, p1y : Float64, p1z : Float64, p2x : Float64, p2y : Float64, p2z : Float64, p3x : Float64, p3y : Float64, p3z : Float64, color : PF::Pixel = PF::Pixel.white)
#
def self.new(p1 : Vector3(Float64), p2 : Vector3(Float64), p3 : Vector3(Float64), color : PF::Pixel = PF::Pixel.white, normal : PF::Vector3(Float64) | Nil = nil)
#
Instance Method Detail
Split the triangle based on which points are inside of a given plane Returns a tuple of 0-2 triangles