Skip to content

Instantly share code, notes, and snippets.

@albisserAdrian
Last active November 3, 2020 11:26
Show Gist options
  • Save albisserAdrian/f98f82b70b5eee97791d75a7feaf48ad to your computer and use it in GitHub Desktop.
Save albisserAdrian/f98f82b70b5eee97791d75a7feaf48ad to your computer and use it in GitHub Desktop.

Convert OBJ and FBX models to JSON using Three.JS

  1. Download and install Node.js

  2. Download three.js

  3. Open in a text editor the <your threejs root folder >/utils/converters/fbx2three.js file

  4. At the top of the file add the following line import * as THREE from "../../build/three.module.js";

  5. Save and close.

  6. Open PowerShell or your preferred command line tool.

  7. Inside the command line go to the root three.js folder cd <your threejs root folder>

  8. Install all the dependencies npm install

  9. Install the esm package npm install esm

  10. For OBJ file run node -r esm utils/converters/obj2three.js model.obj, for FBX file run node -r esm utils/converters/fbx2three.js model.fbx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment