1.7.1_3d_models - MartijnKeesmaat/WebGL-practice GitHub Wiki

3D models are available in hundreds of file formats, each with different purposes, assorted features, and varying complexity. This guide provides a workflow recommended for most users, and suggestions for what to try if things don't go as expected. Where possible, we recommend using glTF (GL Transmission Format). Both .GLB and .GLTF versions of the format are well supported. Features include meshes, materials, textures, skins, skeletons, morph targets, animations, lights, and cameras.

Example

The important and general part of any 3D library its import of external models.

In the beginning, I wanted to create diamond by code but it turned out to be difficult — a lot of lines of code. That is why I decided to import a model. Three.js has many ways to achieve that but I choose import through JSON file.

You could create a model in any 3D editor which I made in Cinema 4d. After I imported the model into ThreeJS editor. ThreeJS editor has a convenient button “publish” it export a model as a JSON file. But when I opened JSON it was very long.

I start to find another way and found that Blender also has a special exporter for three.js. And actually, it showed himself very well.

Sources