how to generate JavaScript 3D for use in Open Source Physics? GitHub repo
how to generate JavaScript 3D for use in Open Source Physics?


  1. Install SketchUp 
  2. Find the 3D object file required in Open Source Physics say aeroplane 
  3. register to the SketchUp software if necessary and download the model
  4. save it on the desktop for ease of finding the model
  5. edit the model so that it is easy to use on the Easy Javascript Modeling tool for example, move the origin to the centre of the plane and aline the direction of the plane to RED x axis
  6. export the mode in format called OBJ and file name say sia or whatever you want
  7. now the file is ready, download the python package called provided by Felix
  8. save the zip file in the desktop and expand the zip file 
  9. if you need python, install it too , use the latest 3.5.2 version
  10. copy the file sia.OBJ into the same folder as the convert folder 
  11. open terminal and navigate to the folder , for me was 
    • \( cd /Users/lookang/Desktop/webgl_convert/convert 
  12. to convert and use the python file, type in 
    • \) python2 sia.obj Object3D_sia.js
  13. that's it!. insert that just created sia.js file as a 3D object in EJSS in the description 

  14. double click the file sia.js and using an editor like notepad or xcode, add Object3D_ to the var declaration 
  15. save the file and copy it to the ejss folder for use.
  16. i used "./gimbal/Shuttle.js" , make sure a folder is used to hold all the assets in the Ejss source
  17. the example can be downloaded here
  18. to view the output, try this
  19. for the example Prof Felix made possible! 


end faq

{accordionfaq faqid=accordion3 faqclass="lightnessfaq defaulticon headerbackground headerborder contentbackground contentborder round5"}
2 1 1 1 1 1 1 1 1 1 1 Rating 2.00 (3 Votes)