C# Class TechEngine.Engine.Model

Show file Open project: DotTech/3D-software-renderer Class Usage Examples

Public Methods

Method Description
AddTriangle ( int v0, int v1, int v2 ) : void
AddVertex ( double x, double y, double z, double intensity = 1 ) : void
CalculateColors ( ) : void

Call once after loading the model

CenterModel ( ) : void

Adjust vertex coordinates so that point 0,0,0 is the center of the model

Model ( ) : System
Transform ( Vector3 camera, double scale ) : void

Performs all transformations required for one rendering cycle

Private Methods

Method Description
BackfaceCulling ( ) : void
CenterPivot ( ) : void

Center the pivot in object space

ProjectVertices ( Vector3 camera, double scale ) : void
Rotate ( ) : void

Perform rotation

Rotate ( Vector3 angles ) : void
SortDepthBuffer ( ) : void

Sort the triangles descending by the sum of all vertices Z value

TransformToCameraSpace ( Vector3 camera ) : void

Method Details

AddTriangle() public method

public AddTriangle ( int v0, int v1, int v2 ) : void
v0 int
v1 int
v2 int
return void

AddVertex() public method

public AddVertex ( double x, double y, double z, double intensity = 1 ) : void
x double
y double
z double
intensity double
return void

CalculateColors() public method

Call once after loading the model
public CalculateColors ( ) : void
return void

CenterModel() public method

Adjust vertex coordinates so that point 0,0,0 is the center of the model
public CenterModel ( ) : void
return void

Model() public method

public Model ( ) : System
return System

Transform() public method

Performs all transformations required for one rendering cycle
public Transform ( Vector3 camera, double scale ) : void
camera Vector3
scale double
return void