Re: java3d, jogamp and an stl viewer
Posted by
ag123 on
Mar 12, 2017; 7:44pm
URL: https://forum.jogamp.org/java3d-jogamp-and-an-stl-viewer-tp4037771p4037772.html
in case the maintainers or any one is trying / testing out the stl viewer app
i noted that some models/objects 'freezes' while others seemed ok, initially i suspected it may be related to file size, however it turns out that this is not necessary true
i tried loading this 'Curro Expo 92 cookie cutter' model by lolo_aguirre from thingverse
http://www.thingiverse.com/thing:2171286/#filesthe file CURRO_INTERIOR.STL which is about 1mb renders just fine and one can pan / rotate around the model to view it

while a smaller file CURRO_EXTERIOR.STL which is about 500k freezes
(in the same link above)
the scene graph in java3d is setup as follows
SimpleUniverse > Locale > Branch group (this is the root) > Transform group (scale) > Branch group > Shape3D (this is the model - all triangles from the STL file is loaded in this node)
there are various bounding spheres and lights (with spherical bounds), i'm not too sure if that is after all the cause of the freezes, do drop a tip / comment
the source can be checked out from github
https://github.com/ag88/stl-viewer if one wants to examine the codes. codes that deal with java3d are mainly in org.stlviewer.PCanvas3D and org.stlviewer.PModel (PModel is the BranchGroup > Shape representing the STL model/object it also loads the triangles when the file is loaded)
thanks in advance