Table of Contents

Class GLTriangle

Namespace
SearchAThing.OpenGL.Core
Assembly
netcore-opengl-core.dll
[JsonObject(MemberSerialization.OptIn)]
public class GLTriangle : GLPrimitiveBase, IGLTriangle, IGLPrimitive, IGLVertexManagerObject, INotifyPropertyChanged
Inheritance
GLTriangle
Implements
Inherited Members
Extension Methods

Constructors

GLTriangle(GLVertex, GLVertex, GLVertex)

Create an opengl triangle by given three vertexes.

public GLTriangle(GLVertex v1, GLVertex v2, GLVertex v3)

Parameters

v1 GLVertex

First vertex.

v2 GLVertex

Second vertex.

v3 GLVertex

Third vertex.

GLTriangle(in Vector3, in Vector3, in Vector3)

Create an opengl triangle by given three coordinates.

public GLTriangle(in Vector3 p1, in Vector3 p2, in Vector3 p3)

Parameters

p1 Vector3

First position.

p2 Vector3

Second position.

p3 Vector3

Third position.

Properties

Plane

Compute default triangle plane such as:

  • origin = V1
  • normal = Normalize((V2-V1) x (V3-V1))
public Matrix4x4 Plane { get; }

Property Value

Matrix4x4
See Also

PlaneNZ

Compute triangle plane such as:

  • origin = V1
  • basez is concordant to owner figure ComputeNormal delegate.
public Matrix4x4 PlaneNZ { get; }

Property Value

Matrix4x4

V1

Triangle first vertex.

[JsonProperty]
public GLVertex V1 { get; set; }

Property Value

GLVertex

V2

Triangle second vertex.

[JsonProperty]
public GLVertex V2 { get; set; }

Property Value

GLVertex

V3

Triangle third vertex.

[JsonProperty]
public GLVertex V3 { get; set; }

Property Value

GLVertex

Vertexes

Enumerate primitive gl vertexes.

public override IEnumerable<GLVertex> Vertexes { get; }

Property Value

IEnumerable<GLVertex>

Methods

Contains(in Vector3)

States if given point is contained in the triangle, borders included.

public bool Contains(in Vector3 point)

Parameters

point Vector3

Point to test.

Returns

bool

CopySpecialized(GLPrimitiveBase)

protected override void CopySpecialized(GLPrimitiveBase other)

Parameters

other GLPrimitiveBase

Lines()

Enumerate triangle as opengl lines (V1,V2), (V2,V3) and (V3,V1).

public IEnumerable<GLLine> Lines()

Returns

IEnumerable<GLLine>

MakeInstance()

protected override GLPrimitiveBase MakeInstance()

Returns

GLPrimitiveBase

Mirror(in Matrix4x4)

Create a mirrored primitive against given xy plane.

public override GLPrimitiveBase? Mirror(in Matrix4x4 xyPlane)

Parameters

xyPlane Matrix4x4

XY mirror plane.

Returns

GLPrimitiveBase

Mirrored primitive.

SimpleCmd(bool)

[t ]x1,y1,z1,x2,y2,z2,x3,y3,z3

public override string SimpleCmd(bool includeHeader = true)

Parameters

includeHeader bool

Returns

string

ToString()

public override string ToString()

Returns

string