Reputation: 2568
I want to make a 3-D viewer using WebGL and the imported model I need to access is an STL or .stl file. I believe I need to convert an STL file to .js so that it can be compatible in a web browser. How do I make the conversion while keeping the integrity and detail of the STL file?
Upvotes: 1
Views: 3463
Reputation: 12632
You do not really have to create a .js
file. You can use the three.js loader
for .stl
files which is located in examples\js\loaders\STLLoader.js
(from your main download location of three.js).
In addition you can look at examples\webgl_loader_stl.html
to see how this is done.
Upvotes: 3