Going 3D

Drawing Quad

It time now to render the Quad using all the functions and structs that I implemented until now.

Vec3 position = Vec3{0.0f, 0.0f, 0.0f};
Vec3 rotation = Vec3{0.0f, 0.0f, 0.0f};
Vec3 scale = Vec3{1.0f, 1.0f, 1.0f};
ColorRGBA color = ColorRGBA{1.0f, 0.5f, 0.31f};

Renderer_DrawQuad(&gRenderer, position, rotation, scale, color);

Screenshot of an orange Quad

This looks like a lot of code to draw a simple rectangle and it is. But this is what GPU APIs do under the hood to render with great performance, graphics in real time.

The next step is to render a Cube, but before that I need to fix something important in my code to detect when a fragment is behind another seen from the view perspective.

Squared Wave SVG