Table of Contents

Class GLTriangleFigure

Namespace
SearchAThing.OpenGL.Core
Assembly
netcore-opengl-core.dll

Specialization of typed figure within the GLTriangle primitive.

public class GLTriangleFigure : GLFigureTypeBase<GLTriangle>, IGLTriangleFigure, IGLFigure, IGLVertexManagerObject, INotifyPropertyChanged
Inheritance
GLTriangleFigure
Implements
Derived
Inherited Members
Extension Methods

Constructors

GLTriangleFigure(params GLTriangle[])

Create a triangle typed figure with the given set of GLTriangle.

public GLTriangleFigure(params GLTriangle[] triangles)

Parameters

triangles GLTriangle[]

GLTriangleFigure(IEnumerable<GLTriangle>)

Create a triangle typed figure with the given set of GLTriangle.

public GLTriangleFigure(IEnumerable<GLTriangle> triangles)

Parameters

triangles IEnumerable<GLTriangle>

Fields

DefaultComputeNormal

Default triangle compute normal function.
DefaultTriangleNormal(IGLTriangle)

public static readonly ComputeTriangleNormalDelegate DefaultComputeNormal

Field Value

ComputeTriangleNormalDelegate

Properties

ComputeNormal

public ComputeTriangleNormalDelegate ComputeNormal { get; }

Property Value

ComputeTriangleNormalDelegate

ComputeNormalMean

public bool ComputeNormalMean { get; }

Property Value

bool

PrimitiveType

Enum that describe which type underlying to the instance.

public override GLPrimitiveType PrimitiveType { get; }

Property Value

GLPrimitiveType

Texture2D

Optional texture 2d object associated to this triangle.
TextureST vertex coords of triangles vertexes will be used to map the texture.
Changing this property emits FigureInvalidated event.

[JsonProperty]
public GLTexture2D? Texture2D { get; set; }

Property Value

GLTexture2D

Triangles

Enumeration of triangle primitives of this figure.

public IEnumerable<GLTriangle> Triangles { get; }

Property Value

IEnumerable<GLTriangle>

Methods

CopySpecialized(GLFigureBase)

protected override void CopySpecialized(GLFigureBase other)

Parameters

other GLFigureBase

MakeInstance()

Create an instance of derived type.

protected override GLFigureBase MakeInstance()

Returns

GLFigureBase
See Also

Mirror(in Matrix4x4)

Create a mirrored figure against given xy plane.

public override GLFigureBase? Mirror(in Matrix4x4 xyPlane)

Parameters

xyPlane Matrix4x4

XY mirror plane.

Returns

GLFigureBase

Mirrored figure.

RebuildNormal(bool)

Execute ComputeNormal function foreach triangle of this figure updating Normal.
Optionally mean these values if ComputeNormalMean was set.

public void RebuildNormal(bool onlyMean = false)

Parameters

onlyMean bool

If true, vertex normal will not recomputed, only mean on their values will be set.

SetupComputeNormal(bool, ComputeTriangleNormalDelegate?)

Set the triangle compute normal function.
If no argument given a default per triangle normal compute will be done.

Changing this property imply RebuildNormal(bool) event.

public void SetupComputeNormal(bool mean = false, ComputeTriangleNormalDelegate? computeNormal = null)

Parameters

mean bool

If true a mean of normals triangle vertexes grouped by position will be computed.

computeNormal ComputeTriangleNormalDelegate

Allow to override default triangle normal function DefaultComputeNormal.

SimpleCmd()

Retrieve simple cmd for a list of triangles.
Coordinates of v1,v2,v3 are separated with comma so there are 9 float separated by comma.
Further triangles are appended by semi-colon separator. [t ]ax1,ay1,az1,ax2,ay2,az2,ax3,ay3,az3;bx1,by1,bz1,bx2,by2,bz2,bx3,by3,bz3;...

public override string SimpleCmd()

Returns

string