C# Class QuadVideo.XYAxesMesh

This object uses a set of quads to represent a mesh that is in the XY plane. A size parameter sets the model coordinate boundaries of the mesh The Resolution determines how many quads are constructed along each axis. This class clearly separates the creation of vertices, indices, and texture coodinates for the sake of clarity. It may not be the most efficient manner, but is probably the easiest to understand, modiy, extend, and maintain. This is not the most optimal representation of a mesh of quads. First, the individual vertices are duplicated rather than shared. This is to allow setting of individual normal vectors, and texture coordinates per vertex. Also, instead of using quad strips, each individual quad is drawn as a separate object. Again, this is for full control of drawing. One scenario might be that each individual quad is drawn and some shader parameters are set before the drawing occurs. This might allow a shader to convey information to the quad such as which position it is in relative to the resolution of the entire mesh.
Inheritance: Mesh3D
显示文件 Open project: Wiladams/NewTOAPIA Class Usage Examples

Public Methods

Method Description
CreateVertices ( ) : void
Render ( GraphicsInterface GI ) : void

This override is called by whomever is controlling the rendering process. We call the base Render method as it will automatically use the vertices, indices, and texture coordinates to draw the quads.

XYAxesMesh ( GraphicsInterface gi, Vector3D boundary, Resolution res, GLTexture texture ) : System

To construct a mesh, we need to know the size and resolution. We also set the texture as a convenience.

Private Methods

Method Description
CreateIndices ( ) : void
CreateMesh ( ) : void

Do the work of creating the mesh vertices, indices, and texture coordinates.

CreateTextureCoords ( ) : void
SetupTextureOptions ( GraphicsInterface GI ) : void

Method Details

CreateVertices() public method

public CreateVertices ( ) : void
return void

Render() public method

This override is called by whomever is controlling the rendering process. We call the base Render method as it will automatically use the vertices, indices, and texture coordinates to draw the quads.
public Render ( GraphicsInterface GI ) : void
GI NewTOAPIA.GL.GraphicsInterface
return void

XYAxesMesh() public method

To construct a mesh, we need to know the size and resolution. We also set the texture as a convenience.
public XYAxesMesh ( GraphicsInterface gi, Vector3D boundary, Resolution res, GLTexture texture ) : System
gi NewTOAPIA.GL.GraphicsInterface
boundary Vector3D The size on the XY plane. The value is not used.
res Resolution The resolution determines how many rows and columns of quads will be generated.
texture NewTOAPIA.GL.GLTexture An optional texture object to be bound to the mesh. /// Normalized texture coordinates will be generated whether a texture object is assigned or not.
return System