Question is: how can I query the x3d object for the current user camera coordinates (viewpoint and view direction), then re-apply the same viewpoint and view direction after reloading the scene?
I'm currently reloading with the reload(); function. But this resets the camera coords to the defaults as defined in the x3d data. I'd like to override this and specify the camera coords which have just been queried previous to the reload.
(BTW You don’t necessarily need to send to mailing list as this Gitter forum is automatically replicated on the mailing list also.)
Thanks James, I see the behavior is that changing viewpoint on one chart will apply the same viewpoint to all the charts. The syncViewpoints(e) function takes that "e" argument - where does the "e" come from, exactly? Is that an event or a viewpoint object? Is it getting bound automatically by the viewpoint which is listening for the viewpointChanged event?
Update: Yep, that event object contains the data I'm looking for, accessible with the e.orientation, e.orientation, and e.position, as you have illustrated. Thank you! When I get my example working and building online, I'll post a link here..
So, the orientations in x3dom are given as axis () and rotation angle (). Of course that makes sense, it's the same representation as in X3D..
@andreasplesch Thank you for that link. A lot of info indeed. The ability to add viewpointChanged-Listeners also to the Scene-Node looks useful, and looks like it should be in the 1.8.0 stable release. Downloading that now..
@andreasplesch Happy to hear that Gendl loaded and started without issues in Jupyter. Which CL implementation is it? From the little I've heard of Jupyter, using Gendl inside Jupyter sounds interesting for sure. I haven't really looked at Jupyter at all yet. So far we just deploy Gendl as a traditional web application server, with its built-in CL-based webserver, and old-school Emacs/Slime as IDE. Rendering a simple box indeed sounds like the next logical step, if your goal is to embed dynamic Gendl models inside a Jupyter notebook. Gendl's online demos and documentation are somewhat lacking and out of date at present; we are working to correct that as soon and as nicely as possible. In the meantime, please reach out to me directly with any issues or if you'd like to discuss ideas for next steps (and let me know here if you need contact info).
Hi Dave, the main issue is that the scenes use Protos which are not completely supported in x3dom. The good news is that the ProtoDeclarations here are effectively simple macros and probably work as x3dom inline in json format.
But this field is only available IndexedFaceSet. So you would need to generate this kind of node from your geometry data.
If you need to use TriangleSet you can explicity define normals at each vertex with a Normal node. For smooth appearance, the normals would need to be the average of the triangle normals around each vertex. Perhaps your backend can generate such normals.
You could use meshlab to convert to IndexedFaceSet.
Thank you! I will try it ASAP. If I'll have any problems this is the best place to discuss?
Any place is fine. Sharing files is easiest on github.
Thank you Andreas, I was able to solve my question. Hovewer, I have another question. I know there is "downloadsfinished" event that fires when x3d file was fully loaded. For some reason sometimes it does not called - probably due to some error. Is there some kind of "onloaderror" event that can be called if downloadsfinished was failed?