Creates a GIF of a supported 3D File with rotation around its axis.
Currently these file extensions are support: .stl, .obj
Clone this project using git
git clone https://github.com/StaticFX/3DModels-To-GIF
The following programs are required to build the project:
The following programs are required to build the project:
- Visual Studio
- Python 2.7
- Python 3 and up
- C++ Desktop Development Kit found in Visual Studio installation manager
The above mentioned programs are required to build gl, the rendering library used to convert three.js scenes into images.
After installing all programs run:
npm i
To run the server use:
npm run dev
There were a few issues that needed to be resolved before this could work. The initial idea was always to use three.js as the library to build the model. The only problem was that three.js was made for webbrowsers and not for nodejs. Therefore we are using gl, which is a headless renderer to render our images. In a nutshell it works by, loading in the 3d model, centering it into the scene and rotating it to be at an angle. Then the distance of the camera is calculated and moved to have the whole model visible. The scene is then being rotated around its axis. Every given angle the renderer renders an image of the current scene. All images are then combined into a .gif file.