Jump to content

Creating a VR Reticle


FlashyGoblin
 Share

Recommended Posts

Has anyone seen an example or know how BabylonJS works with reticles when going into VR mode? I'm looking into having a custom reticle or cursor in my scene to use as a targeting crosshair. My thoughts were to use ray casting.

  1. I would create a plane in front of the my camera that will be textured with a crosshair image
  2. Create a Ray from the middle of a plane out into my scene.
  3. Then pick the 3D Object that it hits first.
  4. Allow it to work with switching to multiple cameras types for when in VR or not. 

I know there are ways of doing this. I'm just a bit confused with the implantation. Anyone have any thought? 

 

Thanks in advance!

Shane

Link to comment
Share on other sites

Hi FG!  Might want to take a look at http://www.babylonjs-playground.com/#6FFQW#16   (for both reticle and pickingWithRay things)

'PickingRay', yep yep yep.  Or 'ray', or 'picking', or 'intersect'... all good playground search-fodder, indeed.  if .hit, pickingInfo object has a pile of good data stored on it, and you can pillage that puppy.  Search search search... those topics are hot. :) 

Our virtual joysticks use an add-on canvas... to paint it's colored virtual-controller rings-onto.  It works pretty nice.

Umm... you might want to look into a thing called "layer", too.  Good luck.

Link to comment
Share on other sites

On 4/7/2016 at 9:21 PM, Wingnut said:

Hi FG!  Might want to take a look at http://www.babylonjs-playground.com/#6FFQW#16   (for both reticle and pickingWithRay things)

'PickingRay', yep yep yep.  Or 'ray', or 'picking', or 'intersect'... all good playground search-fodder, indeed.  if .hit, pickingInfo object has a pile of good data stored on it, and you can pillage that puppy.  Search search search... those topics are hot. :) 

Our virtual joysticks use an add-on canvas... to paint it's colored virtual-controller rings-onto.  It works pretty nice.

Umm... you might want to look into a thing called "layer", too.  Good luck.

Wingnut, I just realized that I never thanked you for your response. It was very helpful! Thank you!

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...