cat3d
A tiny OpenGL 3D engine library written in and for C++.
cat3d

badge

A tiny OpenGL 3D engine library written in and for C++.

Dependencies

Building from source

This project is built using CMake

cd build
cmake \
-DBUILD_TESTS=ON \
-DBUILD_EXAMPLES=ON \
..
make

To run the tests, use:

make test

Docs

You can view the docs here.

Examples

More examples are located in the examples/ directory.

#include <cat3d.hpp>
int main() {
namespace obj = cat3d::obj;
cat3d::init(cat3d::opts(
{ { cat3d::WIDTH, 800 },
{ cat3d::HEIGHT, 600 },
{ cat3d::TITLE, "spinning-cube" },
{ cat3d::CLEAR_COLOR, cat3d::color::from_rgb(100, 242, 245) } }));
cat3d::scene::node* root = cat3d::new_scene();
obj::camera* cam = root->create<obj::camera>(glm::vec3(0, 2, -4), glm::vec3(0, 0, 0), 75.f);
obj::model* cube = root->create<obj::model>("examples/cube.obj");
cube->create<obj::timer>([cube](cat3d::util::time dt) {
float dts = dt.as_seconds();
cube->transform().rotate(glm::vec3(1.f * dts, 0.2f * dts, 0));
});
return cat3d::run();
}

Gif of above example

cat3d::scene::node::create
Obj * create(Args... args)
Add a derived node class as a child.
Definition: node.hpp:106
cat3d::util::time
Class representing a duration of time.
Definition: clock.hpp:11
cat3d::color::from_rgb
static color from_rgb(float r=0, float g=0, float b=0, float a=255)
Generate a color from standard 0-255 RGBA values.
cat3d::scene::node
Basic, semi-abstract scene node class. Can have children which are other scene nodes,...
Definition: node.hpp:28
cat3d::opts
cat3d main configuration options class
Definition: opts.hpp:22