dinod Posted April 11, 2017 Share Posted April 11, 2017 Total Babylon noob here looking for some help! I'm working on a WebVR game and want to add in some 2D elements like a small "Press the A button to start" box. How would I go about something like this? I've played around with Canvas2D but for some reason have only been able to get it to show the 2D element through one eye of my headset and have since scrapped that idea. Any ideas for the best way to go about this would be much appreciated! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 11, 2017 Share Posted April 11, 2017 ping @davrous who (I think) tackled that already Quote Link to comment Share on other sites More sharing options...
jschwuch Posted April 12, 2017 Share Posted April 12, 2017 I suspect you tried to use the screenSpaceCanvas. It's expected that it is only visible on "one" eye as it's positioned relative to the screen, which is "split in half" for VR, and not to the scene. I prepared an example utilizing the worldSpaceCanvas that shows canvas2D elements on both eyes http://babylonjs-playground.com/index.html#NJBBC9 GameMonetize and dinod 2 Quote Link to comment Share on other sites More sharing options...
davrous Posted April 13, 2017 Share Posted April 13, 2017 Hello, Here is a small sample I've created: http://www.babylonjs-playground.com/#6PVF0Y#2 that shows how to: - Use WebVRCamera with a fallback to DeviceOrientation camera for Cardboard/mobile support - Use Canvas2D in World Space mode to integrate some 2D UI in VR Should be a good starting point. David meteoritool, GameMonetize and dinod 3 Quote Link to comment Share on other sites More sharing options...
davrous Posted April 13, 2017 Share Posted April 13, 2017 Here's one with some 3D assets loaded: http://www.babylonjs-playground.com/#6PVF0Y#5 meteoritool, GameMonetize, Wingnut and 1 other 4 Quote Link to comment Share on other sites More sharing options...
dinod Posted April 14, 2017 Author Share Posted April 14, 2017 Thanks so much everyone!! This is exactly what I needed. Wingnut and davrous 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.