Open GoogleCodeExporter opened 8 years ago
[deleted comment]
[deleted comment]
It seems you just uses a single stl_loader object to load mutiple models. Try
creating a new instance of JSC3D.StlLoader() each time when you are to load a
new STL file:
reader.onload = (function(file) {
return function(e) {
...
stl_loader = new JSC3D.StlLoader();
stl_loader.parseStl(theScene, e.target.result);
...
};
}
Additionally, I notice that in init_viewer() you create a new instance of
JSC3D.Viewer each time a new model is loaded, which results in multiple viewers
attached to a same canvas. It should be avoided by moving init_viewer():
function init_viewer() {
viewer = new JSC3D.Viewer(mycanvas);
...
viewer.init();
viewer.update();
}
to the very beginning of the script and executed only once.
Original comment by Humu2...@gmail.com
on 2 Oct 2013 at 4:25
Hi Humu. I refactored reader.onload to:
reader.onload = (function(file) {
return function(e) {
theScene = new JSC3D.Scene
stl_loader = new JSC3D.StlLoader()
stl_loader.parseStl(theScene, e.target.result)
viewer.init()
viewer.replaceScene(theScene)
viewer.update()
}
})(f)
The flicker of old geometry is still there, however -- see the attached screen
photo. (I had to take a photo of my screen because screen-capture doesn't show
the effect.)
Original comment by liav.ko...@gmail.com
on 2 Oct 2013 at 3:24
Attachments:
It looks strange. Are you sure there is only a single instance of JSC3D.Viewer
in your application?
Original comment by Humu2...@gmail.com
on 2 Oct 2013 at 4:23
The only code that touch JSC3d on that page is the code I've posted here. After
upload there's a redirect to a results page with another canvas/JSC3D instance,
which pulls STLs from the server. That one works fine.
The issue appears on Chrome and Firefox under both Ubuntu 12.04 and Win7.
Original comment by liav.ko...@gmail.com
on 2 Oct 2013 at 11:43
Hi, Liav, could you show me some runnable stuff that can reproduce the issue?
Original comment by Humu2...@gmail.com
on 3 Oct 2013 at 6:39
Hi Humu. I sent you the IP for a testing server.
Original comment by liav.ko...@gmail.com
on 3 Oct 2013 at 3:48
Thanks Liav! I'll see it as soon as possible.
Original comment by Humu2...@gmail.com
on 3 Oct 2013 at 3:57
Original issue reported on code.google.com by
liav.ko...@gmail.com
on 2 Oct 2013 at 12:42