Open dllahr opened 6 years ago
We have a stereoViewer already. It would be great if someone could take the effort to properly parameterize the settings for various VR headsets (e.g. Google Cardboard) and implement a motion-based control scheme.
I do not think it is a good idea to reimplement the rendering engine. It is implemented the way it is for performance reasons.
@dkoes Thanks for the fast response. Could you point us to an example of how to use the stereoViewer? I can't find it in the documentation.
Yes, documentation (and greater configurability) is something that remains on the todo list. Here is an example of it in use: http://3dmol.csb.pitt.edu/tests/auto/generate_test.cgi?test=test96
What we need to do (I think) is adjust the camera settings (in particular the eye offset) to match the VR viewer and, more importantly, the size of the scene. I think scaling so that the bounding sphere of the scene appears about the size of a large beachball held at arms length would be good. There also needs to be programmer control to scale the apparent size.
Thanks. Ideally, we'd be able to tie it into one of the existing WebVR frameworks so that we can make use of their headset and controller support. I'll dig in to see if that's a possibility.
It seems like all the existing WebVR frameworks (like A-Frame or Babylon.js) either implement their own wrappers around WebGL (babylon) or use another wrapper library (aframe uses three.js). I can't see a way to tie 3DMol.js into one of those frameworks without refactoring it to use a different WebGL wrapper.
So to add WebVR support to 3DMol and keep the current rendering engine, we'd need to tie the stereoViewer into the WebVR API directly. The WebVR API should be able to feed information about the camera settings and matrix transforms to the stereoViewer. I'm still figuring out how the rendering engine works, so I'm not sure yet how difficult that will be.
Isn't WebVR being deprecated in favor of WebXR which isn't ready for use yet?
It is. One of the reasons why I was hoping to be able to tie into A-Frame is that it would act as an abstraction layer to insulate against those upcoming changes to the underlying API. Since that's not an option, maybe it would be better to wait on implementing this until WebXR is more stable.
Cool!
@dkoes
Hello Dave
I hope things are well with you. I've reconnected with a former colleague (Steve Brudz, @sbrudz) who is now working on javascript code for virtual reality (e.g. https://github.com/sbrudz/vr-us-population), and I proposed that we work on some biology visualization, trying to combine 3DMol with the VR library / code he's using. I've included @sbrudz 's ideas for how to do this below - short version, implementing a new version of GLViewer. A couple questions -
Thanks in advance, looking forward to hearing your thoughts!
from @sbrudz: