FreeCad to WebGL
Jump to navigation
Jump to search
GLTF Loader Technique
No Part Explosions
Step 1: FreeCad to glTF
- In FreeCad, export your part as .obj and open it in Blender. Follow FreeCad to Blender guide.
- Make sure Blender has the GLTF Export Addon installed.
- Edit->Preferences->Addons-> Search for GLTF and install Import-Export as GLTF 2.0
- In Blender, File-> Export -> GLTF 2.0
- Save your file. It will save with filetype .glb
Step 2: Create Project Folder
- Create a project folder
- Create a subfolder for your javascript libraries. Include three.min.js , GLTFLoader.js, and OrbitControls.js
- Put your .glb file in your project folder
Step 3: Create WebGL HTML File
- For now, just use my crappy template. With THREE.js you create a scene with controls, cameras, lights, perspective, window size. Don't worry about all that.
- Just start by downloading this file: glTF Loader Template and saving it in your project folder as Project Name.html