C# Class TechEngine.Engine.FrameBuffer

显示文件 Open project: DotTech/3D-software-renderer Class Usage Examples

Public Methods

Method Description
Clear ( ) : void
DrawLine ( Vector3 point0, Vector3 point1, int color ) : void

Draw a line from point0 to point1 in the framebuffer

http://en.wikipedia.org/wiki/Bresenham's_line_algorithm

DrawLine ( int x0, int y0, int x1, int y1, int color ) : void

Draw a line from point x0,y0 to x1,y1 in the framebuffer

DrawModel ( Model model ) : void

Draw a mesh model after it has been processed (transformed and projected)

DrawPixel ( Vector3 point, int color ) : void

Draws a pixel to the framebuffer

DrawPixel ( int x, int y, int color ) : void

Draws a pixel to the framebuffer

DrawTriangle ( Model model, Triangle triangle ) : void

Draw a (filled) triangle to the framebuffer

http://www-users.mat.uni.torun.pl/~wrona/3d_tutor/tri_fillers.html

FrameBuffer ( Size size ) : System

Private Methods

Method Description
DrawTriangleScanline ( double x0, double x1, double y, int linecolor, int fillcolor ) : void

Draw one horizontal scanline of a triangle

Method Details

Clear() public method

public Clear ( ) : void
return void

DrawLine() public method

Draw a line from point0 to point1 in the framebuffer
http://en.wikipedia.org/wiki/Bresenham's_line_algorithm
public DrawLine ( Vector3 point0, Vector3 point1, int color ) : void
point0 Vector3
point1 Vector3
color int
return void

DrawLine() public method

Draw a line from point x0,y0 to x1,y1 in the framebuffer
public DrawLine ( int x0, int y0, int x1, int y1, int color ) : void
x0 int
y0 int
x1 int
y1 int
color int argb value for color
return void

DrawModel() public method

Draw a mesh model after it has been processed (transformed and projected)
public DrawModel ( Model model ) : void
model Model
return void

DrawPixel() public method

Draws a pixel to the framebuffer
public DrawPixel ( Vector3 point, int color ) : void
point Vector3
color int
return void

DrawPixel() public method

Draws a pixel to the framebuffer
public DrawPixel ( int x, int y, int color ) : void
x int
y int
color int argb value for color
return void

DrawTriangle() public method

Draw a (filled) triangle to the framebuffer
http://www-users.mat.uni.torun.pl/~wrona/3d_tutor/tri_fillers.html
public DrawTriangle ( Model model, Triangle triangle ) : void
model Model
triangle Triangle
return void

FrameBuffer() public method

public FrameBuffer ( Size size ) : System
size System.Drawing.Size
return System