Winscreen / jsc3d

Automatically exported from code.google.com/p/jsc3d
0 stars 0 forks source link

How to use StlLoader and loadFromUrl properly? #36

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. I want to load .stl via STLLoader
2. Can't get it work.
3. There is no documentation or examples for this method online.

What is the expected output? What do you see instead?
I want to load .stl into viewer but it's not working.

What version of the product are you using? On what operating system?
JSC3D 0.9.8 full release / Windwos XP 64

Please provide any additional information below.
Could anybodu please write me a simple code that will load .stl into a 
viewer/scene using StlLoader? I just want to know how it works. I don't want to 
use setParameter method.

Original issue reported on code.google.com by radas...@gmail.com on 15 Jul 2013 at 5:09

Attachments:

GoogleCodeExporter commented 9 years ago
I'm sorry for the bad documentation.

Since all resource requests should be asynchronous, the STL loader provides an 
event handler named 'onload' which should be overridden to get the parsed scene 
object when loading is done.

So the simplest snnipet to demonstrate this may be:

  var stl_loader = new JSC3D.StlLoader();
  stl_loader.onload = function(scene) {
    viewer.replaceScene(scene);
  };
  stl_loader.loadFromUrl('your-model.stl');

That's it.

Original comment by Humu2...@gmail.com on 15 Jul 2013 at 7:09

GoogleCodeExporter commented 9 years ago
alright
what im realy trying to achieve is to load many .stl files as parts, not as
a scene

so i could build one model from many stl files
is that even possible with jsc3D?

Original comment by radas...@gmail.com on 16 Jul 2013 at 11:08