FreeCad to WebGL

From Open Source Ecology
Revision as of 20:28, 6 October 2019 by Aidan Williamson (talk | contribs) (Created page with "=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....")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

GLTF Loader Technique

No Part Explosions

Step 1: FreeCad to glTF

  1. In FreeCad, export your part as .obj and open it in Blender. Follow FreeCad to Blender guide.
  2. Make sure Blender has the GLTF Export Addon installed.
    1. Edit->Preferences->Addons-> Search for GLTF and install Import-Export as GLTF 2.0
  3. In Blender, File-> Export -> GLTF 2.0
    1. Save your file. It will save with filetype .glb

Step 2: Create Project Folder

  1. Create a project folder
  2. Create a subfolder for your javascript libraries. Include three.min.js , GLTFLoader.js, and OrbitControls.js
  3. Put your .glb file in your project folder

Step 3: Create WebGL HTML File

  1. 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.
    1. Just start by downloading this file: glTF Loader Template and saving it in your project folder as Project Name.html