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
Properties
ComputeNormal
public ComputeTriangleNormalDelegate ComputeNormal { get; }
Property Value
ComputeNormalMean
public bool ComputeNormalMean { get; }
Property Value
PrimitiveType
Enum that describe which type underlying to the instance.
public override GLPrimitiveType PrimitiveType { get; }
Property Value
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
Triangles
Enumeration of triangle primitives of this figure.
public IEnumerable<GLTriangle> Triangles { get; }
Property Value
Methods
CopySpecialized(GLFigureBase)
protected override void CopySpecialized(GLFigureBase other)
Parameters
other
GLFigureBase
MakeInstance()
Create an instance of derived type.
protected override GLFigureBase MakeInstance()
Returns
- See Also
-
Copy()
Mirror(in Matrix4x4)
Create a mirrored figure against given xy plane.
public override GLFigureBase? Mirror(in Matrix4x4 xyPlane)
Parameters
xyPlane
Matrix4x4XY 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
boolIf 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
boolIf true a mean of normals triangle vertexes grouped by position will be computed.
computeNormal
ComputeTriangleNormalDelegateAllow 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()