trying to display vpython in immersive virtual reality(vr) like head mouonted display

157 views
Skip to first unread message

Randy Yang

unread,
May 31, 2016, 2:57:59 AM5/31/16
to VPython-users
hi all,

i am trying to display vpython content in immersive virtual reality environment like samsung gear vr hmd (head mounted display)
but find out vpython cannot exe in unity, unreal engine, and android java platform.

is there any chance to make vpython content display in any hmd?
thank you.

share some of my experience:
1. i tried another way: convert classic vpython to glowscript vpython that can exe in a browser 
and with the ability of Samsung Internet for Gear VR app (browser) that supporst WebVR.
but fail on integrating glowscript vpython (javascript) and WebVR sample program (using WebGL)
2. i modified sample bouncing ball.py with 
scene.stereo = 'passive'
scene.stereodepth = 1.5
scene.fullscreen = 1
i can show the content in "stereo" but not "immersive" (360 degree)
3. the work from 2 is not effected if i convert the program to glowscript (single view)

Regards.

Steve Spicklemire

unread,
May 31, 2016, 5:38:31 AM5/31/16
to vpytho...@googlegroups.com, Steve Spicklemire
Hi Randy,

I’m guessing the easiest way forward for this kind of use is webvr <https://webvr.info> with glowscript, but at this time I’m not aware that anyone has implemented the necessary functionality to make this work. I would love to be mistaken. ;-) Contributions welcome! It would be really nice to be able to put your phone into a google cardboard viewer <https://en.wikipedia.org/wiki/Google_Cardboard> and immerse yourself in a vpython scene!

sorry,
-steve
> --
> You received this message because you are subscribed to the Google Groups "VPython-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vpython-user...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Bruce Sherwood

unread,
May 31, 2016, 10:01:47 AM5/31/16
to VPython-users, Steve Spicklemire
I too would love to see VPython be usable in VR, but it will presumably require a lot of work.

GlowScript does not currently support scene.stereo nor scene.stereodepth nor scene.fullscreen. These don't give an error, because you can add your own attributes to VPython objects, so the following code prints "passive" but doesn't do anything:

scene.stereo = 'passive'
print(scene.stereo)


Nor does Classic VPython do anything with scene.stereo = 'passive'; see

Randy Yang

unread,
Jun 2, 2016, 11:37:48 AM6/2/16
to VPython-users, stevespi...@gmail.com
i do try to use webvr with glowscript. 

i tried to integrate glowscript vpython (javascript) and WebVR sample program (using WebGL) but fail,
with converting classic vpython program to glowscript vpython
and with the ability of Samsung Internet for Gear VR app (browser) that supporst WebVR.
as the note in gs forum link

not sure what the necessary functionalities to make this work.

Randy Yang

unread,
Jun 2, 2016, 11:47:04 AM6/2/16
to VPython-users, stevespi...@gmail.com
checked gs does not support scene.stereo from canvas.html

but i think classic support , and did try scene.stereo with bouncing ball, though not immersive
"Setting scene.stereo = 'passive' produces side-by-side images which if small enough can be seen in 3D by looking "wall-eyed", looking into the far distance but focusing on the screen (this too takes some practice), or by using inexpensive stereoscopic viewers."

Bruce Sherwood

unread,
Jun 2, 2016, 1:29:50 PM6/2/16
to VPython-users, stevespi...@gmail.com
Forgetful on my part -- Classic VPython does indeed support "passive". However, GlowScript VPython does not currently support any stereo mode, and Jupyter VPython uses the GlowScript library to do the 3D rendering, so it also does not support any stereo mode.

I personally know nothing about VR and have no idea what would be required to use VPython in a VR environment.
Reply all
Reply to author
Forward
0 new messages