struct PF::Tri

Defined in:

3d/tri.cr

Constructors

Instance Method Summary

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) #

[View source]
def self.new(p1 : Vector3(Float64), p2 : Vector3(Float64), p3 : Vector3(Float64), color : PF::Pixel = PF::Pixel.white, normal : PF::Vector3(Float64) | Nil = nil) #

[View source]

Instance Method Detail

def *(mat : Matrix) #

Multiply all points by a Matrix, returning a new Tri


[View source]
def 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


[View source]
def color : PF::Pixel #

[View source]
def color=(color : PF::Pixel) #

[View source]
def normal #

Return the normal assuming clockwise pointing winding


[View source]
def normal=(normal : Vector3(Float64) | Nil) #

[View source]
def p1 : Vector3(Float64) #

[View source]
def p1=(p1 : Vector3(Float64)) #

[View source]
def p2 : Vector3(Float64) #

[View source]
def p2=(p2 : Vector3(Float64)) #

[View source]
def p3 : Vector3(Float64) #

[View source]
def p3=(p3 : Vector3(Float64)) #

[View source]
def x #

Get the average x value


[View source]
def y #

Get the average y value


[View source]
def z #

Get the average z value


[View source]