Skip to content

Implementing a software rasteriser

To implement a software rasteriser we need to define

Camera field of view

Wider makes things look fisheye, narrower makes things look zoomed in or flat. Converted to radians when using trig functions in C that expect radians.

60.0f is a good starting value.

Near and far planes

Near plane is set to 0.1 to ensure we don't divide by zero. Far plane can be ignored.

Maths types and functions

These can be found in external libraries, and it's probably better to use one instead of deriving your own.

Depending on the renderer you are building, these can be basic linear algebra or matrix transformations.

You will need * 2D and 3D vector types * RGBA colour type * Rotation in X, Y, Z * Translation

See My basic renderer in Gitlab for the code And also Basic 3D Software Rasterisation