Open daniel-adriano opened 7 years ago
Can be based on https://github.com/mrdoob/three.js/blob/dev/examples/js/effects/AnaglyphEffect.js. Would suggest to implement in the NGL viewer class by adding the necessary texture targets and shader.
I suggest to go with the three.js one, whose math is based on https://github.com/tschw/angler.js/
We'd love to have simple cross-eyed stereo view - for both cBioPortal.org (showing cancer relevant mutations in 3D protein) as well as EVfold.org (protein 3D structure prediction using evolutionary couplings from multiple sequence alignments)
Hi, I just added a first version for a stereo view to NGL. You can try it on http://nglviewer.org/ts2/. Accessible as a new camera option 'stereo'. Note that the stereo camera currently does not support picking and super sample anti aliasing.
hi, stereo divide the camera in two, its possible add the three.js and use the propiety "anaglyph"?
@newzhongdan not directly but you could use the three.js implementation as a starting point to add it to NGL
I created a proof of concept component for A-Frame to allow more complex view setups and VR/AR headsets: https://github.com/KJStrand/ngl/blob/AFRAME-NGL/AFRAME_COMPONENT.md As an A-Frame component, NGL could much more easily extended for custom use cases: https://blog.bluepengu.in/a-new-scratchpad-for-science-e9901955db96
Like it! As most of the changes are to stage and viewer classes I wonder if an AFrameStage could avoid breaking the normal behaviour, or make sufficient changes in NGL that a small shim package could implement the A-frame behaviour? (I've not thought this through much, just thinking aloud...).
Yes I think the changes could be kept to a minimum. My code changes are pretty hacked together; I don't have a good enough understanding yet of the NGL render pipeline so I commented out camera render code to suppress errors, and some of the shaders (such as the impostor shader) aren't correctly set up with the A-Frame camera. A-Frame maintains its own Three scene, so it would be best for an NGL A-Frame component to link geometry directly to the existing scene and not create a viewport div, cameras, lights, or interactions. Trajectory animations should also be changed to connect directly to A-Frame's tick handler: https://aframe.io/docs/0.8.0/core/component.html#tick-time-timedelta. I think text is also causing some issues and not displaying correctly in A-Frame.
Custom mouse behaviors and camera setups could still be applied, maybe even as A-Frame components themselves.
@arose For the stereoscopic mode, is there a setting that would allow to change the angle between the two individual structure views?
Thanks!
A way to enable stereoscopic mode for jupyter notebooks? For example: two parallel (side by side) views for left and right eye; cyan/red; interleaved; etc.