3D Duktape and preact
18 Apr 2017 | preact ducktable three.cppI discovered this great post by Ben Nolan today. It explains how to render in 3D each reddit thread so you could browse this on an AndroidTV, an iOs device or a VR environment.
The tech stack used for the project is really interesting:
- three.cpp : a port of three.js but in C++. Basically this is a simple 3D scene manager/renderer. three.cpp is C++ 11 compatible and uses OpenGL and SDL and is thus super portable.
- Preact : small JS library to generate a DOM. Why mix C++ and JS? More on this below.
- duktape: a single file C library that is an embeddable Javascript engine!
The goal of the project was to be portable and small, hence using C++. But Ben wanted users to be able to hack the way reddit threads are rendered. Hence a Javascript library (preact) with a Javascript evaluator. For now this project is not available on github but I hope it will be soon!