<p>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.</p>

<p>For defining the scenegraph structure you could look at glTF(<a href="https://github.com/KhronosGroup/glTF" rel="nofollow">https://github.com/KhronosGroup/glTF</a>) defined by Khronos themselves. This really depends on what kind of features your scene graph requires.</p>

<p>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 (<a href="https://github.com/kripken/emscripten" rel="nofollow">https://github.com/kripken/emscripten</a>). Otherwise provide a C-interface and call it directly using ccall(). This way you can directly share this datastructure via parameters.</p>

CC BY-SA 3.0
2016-03-10T10:53:03.073Z
The scene graph technique that I am looking forward to implement is very similar to the http://www.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.
sajis997
CC BY-SA 3.0
2016-03-10T16:31:28.303Z
I would either look into the javascript library http://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).
Maurice
CC BY-SA 3.0
2016-03-09T16:14:24.720Z
2016-03-09T16:14:24.720Z
Maurice
<p>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 ?</p>

<p>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. </p>

<p>Let me know if I have not explained the issue well enough. </p>

<p>Thanks</p>

<javascript>
Get data from javascript
sajis997
# Get data from javascript

(Asked by: username_0 on 2016-03-07)

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.

Thanks

**Tags:** javascript


---

## 1 answers

### Answer by username_1 on 2016-03-09. Score: 2

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.

> **Comments:**
> **username_0**: The scene graph technique that I am looking forward to implement is very similar to the http://www.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.  
> **username_1**: I would either look into the javascript library http://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).  

---

