Home » Blog » Other » B-Rend3r – to understand 3d engines

B-Rend3r – to understand 3d engines

B-Rend3r is written in C++. I’m using OpenGL and SDL2 to build a minimalist 3d application with the main goal to understand the core of 3d engines by implementing common classes like: Vec3, Mat44, Mesh Generator, Renderer, Transform, etc.

To give you some details, the Shape component generates the circle’s mesh when program starts, then the KeyboardController handle user inputs to generate a force to apply to the circle, the Physics component apply a smooth before to effectively move the circle using the Transform component (sets position/rotation/scale).

Video – The user is moving a red circle using keyboard arrows. 

Architecture

The program architecture tends to use the ECS (Entity Component System) paradigm. As you can see in the diagram below, an entity (Model) can have several components (Component<T> and derived) attached. There are only two systems (BRend3R and Renderer). This piece of code was an exercise and I didn’t push it further. This was enough to get some answers to the questions I had when I started.

Source code

If you’re interested by the code source, you can browse my github repository

Laisser un commentaire