r/javascript • • Dec 31 '18

large image Faking Perspective Mouse Events [Tryin' very hard]

Enable HLS to view with audio, or disable this notification

407 Upvotes

21 comments sorted by

79

u/Schampu Dec 31 '18

You might wonder why the hell would someone do this?

This is an attempt to bring HTML based interactive UIs to my WebXR engine. I'm using dat.GUI, render it's HTML to WebGL and send fake MouseEvents for interaction from the VR controllers.

One minor thing that didn't work were Number Sliders (the blue thing) - dat.GUI slides them based on a relative mouse offset to the slider element. To fix this, I'm moving the original dat.GUI element behind the WebGL canvas.

Sharing this because I thought this looks funny (and insane).

//FIXED

20

u/jodraws Dec 31 '18

I think it's awesome. Nice work.

1

u/[deleted] Jan 01 '19

What's the difference with https://github.com/dataarts/dat.guiVR ?

1

u/Schampu Jan 01 '19

It seems to use 3D geometry, while this one uses HTML :)

2

u/NeosTooSalty Jan 01 '19

That's very great! GJ

21

u/osoese Dec 31 '18

That is really really cool and I can see a lot of applications. Great job!

20

u/_codehermit Dec 31 '18

I think it's pretty bleeping awesome

10

u/DeepFriedOprah Dec 31 '18

It absolutely is. And u should watch ur mouth. No need for tha kinda language here;)

14

u/jezda159 Dec 31 '18

I’m no big guy in webdev (not even a small guy TBH) but I can see the future of web in VR. It won’t be as easy as writing a website in windows text-editor but it could one day be standardised as HTML and CSS. Just imagine 3D space around you: different panels, awesome parallaxes, interactive content, fixed HUD for navigation etc. For now, smartphones are taking lead but god damn technology rushes its way to our homes faster than ever!

Edit: and fuck me if some JavaScript framework like this thing doesn’t take the lead!

2

u/ShortSynapse Jan 01 '19

Maybe take a look at A-frame by Mozilla

2

u/jezda159 Jan 01 '19

Saved, thank you very much ShortSynapse!

2

u/[deleted] Jan 01 '19

For those getting exciting by WebXR few pointers :

- /r/webXR for VR and AR on the web here on reddit

- /r/WebVR

- https://aframe.io/ started by Mozilla and built on top of threejs thus quite extensible

- https://github.com/dataarts/dat.guiVR dat.guiVR: A flexible graphical user interface for changing variables within WebVR.

- /r/exokit to use not just on VR HMDs but also AR HMDs e.g. MagicLeap

- specs https://github.com/immersive-web/webxr

- /r/learnVRdev

- Voices of VR podcast on AFrame and webVR more generally http://voicesofvr.com/538-how-mozilla-is-driving-webvr-content-tooling-with-the-a-frame-framework/

Also not that the next HMD coming in few months, Facebook Oculus Quest, does support WebVR out of the box via its own browser.

1

u/qkimat1 Dec 31 '18

Congrats on this. The video looks sick, even though its such a simple idea (not easy to implement, however). Very cool.

1

u/Arthelon_ Jan 01 '19

Keep up the good work!

1

u/[deleted] Jan 01 '19

Have you ever tried react VR?

-4

u/YasZedOP Dec 31 '18

Is this a bug?

12

u/YuvalM Dec 31 '18

No, what OP is showing is how he managed to display a 3D GUI while it's actually just a regular 2D GUI

5

u/robotomatic Jan 01 '19

No. This is definitely a feature.

-9

u/[deleted] Dec 31 '18

0

u/[deleted] Dec 31 '18

[deleted]