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
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
Properties
Plane
Compute default triangle plane such as:
- origin = V1
- normal = Normalize((V2-V1) x (V3-V1))
public Matrix4x4 Plane { get; }
Property Value
- See Also
PlaneNZ
Compute triangle plane such as:
- origin = V1
- basez is concordant to owner figure ComputeNormal delegate.
public Matrix4x4 PlaneNZ { get; }
Property Value
V1
Triangle first vertex.
[JsonProperty]
public GLVertex V1 { get; set; }
Property Value
V2
Triangle second vertex.
[JsonProperty]
public GLVertex V2 { get; set; }
Property Value
V3
Triangle third vertex.
[JsonProperty]
public GLVertex V3 { get; set; }
Property Value
Vertexes
Enumerate primitive gl vertexes.
public override IEnumerable<GLVertex> Vertexes { get; }
Property Value
Methods
Contains(in Vector3)
States if given point is contained in the triangle, borders included.
public bool Contains(in Vector3 point)
Parameters
point
Vector3Point to test.
Returns
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
MakeInstance()
protected override GLPrimitiveBase MakeInstance()
Returns
Mirror(in Matrix4x4)
Create a mirrored primitive against given xy plane.
public override GLPrimitiveBase? Mirror(in Matrix4x4 xyPlane)
Parameters
xyPlane
Matrix4x4XY 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
ToString()
public override string ToString()