There is an web-interface that load geometric models and show it inside the bounding volume. WebGL is used to generate it. So far no scene graph technique is used to organize the elements in the scene. Is there any javascript api that does support the scene graph technique ?

If there is, I am also required to know more if there is any mechanism to transfer the scene graph related information from the javascript to C++ based API. As of right now the scene that is developed without scenegraph technique stores that scene as an .stl file and C++ based API read the .stl file and process further. I believe that it is not the optimal way to deal with it. It would have much faster and optimal if we have the scene graph system support in javascript to organize the scene and the direct scene related data transfer from javascript to C++ for further processing.

Let me know if I have not explained the issue well enough.



1 Answer 1


There does not seem to be a single answer for this question, but I will try to give some directions in possible solutions. First of all I presume that "the scene graph technique" means storing the object data in some kind of data structure (I know what a scenegraph is, but there are many different possibilities for indoor/outdoor scenes etc). There seem to be some Javascript libraries, but they do much more then simply providing the datastructure.

For defining the scenegraph structure you could look at glTF(https://github.com/KhronosGroup/glTF) defined by Khronos themselves. This really depends on what kind of features your scene graph requires.

If the C++ library is required for the processing you can look into providing Javascript bindings for it. You can either try to compile the library to javascript using emscripten (https://github.com/kripken/emscripten). Otherwise provide a C-interface and call it directly using ccall(). This way you can directly share this datastructure via parameters.

  • $\begingroup$ The scene graph technique that I am looking forward to implement is very similar to the openscenegraph.org . I have used it for a while and I am familiar to it. The scene that you created with it can be stored as a trivial file format which can be processed further by this library. $\endgroup$
    – sajis997
    Mar 10, 2016 at 10:53
  • $\begingroup$ I would either look into the javascript library osgjs.org, which also is based on openscenegraph.org. But if you want to have more control over the interaction with the library i would suggest trying to compile the openscenegraph using emscripten (as it is open source), or leaving the compiled library as is and creating javascript to c++ bindings for it (also possible with emscripten iirc). $\endgroup$
    – Maurice
    Mar 10, 2016 at 16:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.