Forum Discussion
Qix
11 years agoExplorer
How to select object by looking at it?
Hi guys,
Not sure if this has been asked before. How do I select an object just by looking at it. Something like Proton pulses menu system.
Thanks
Not sure if this has been asked before. How do I select an object just by looking at it. Something like Proton pulses menu system.
Thanks
4 Replies
Replies have been turned off for this discussion
- gmadrigalExplorerI'm new to all of this but I would imagine you would need to make a game object that its opacity is 0% and extends from your player's camera view so when it collides with certain objects it can trigger any behavior. I'm learning about Unity and would like to know an answer to your question as well. :)
- AnonymousWithout going into implementation details, i would think if 'casting a ray' from the center of the camera outward to a certain extent. I am pretty sure this is used in unity for some example as well.
Should be enough information available on that. - FluffyFreakHonored GuestYou project a ray from the centre of the view outwards in the direction that you're looking and test to see what objects it collides with.
The terms you're probably looking for are ray projection, ray-sphere collision, ray-mesh collision.
You can do other things like just taking the dot product of the angle between the view direction, and the direction towards each UI element. When you find that smallest dot product, that's the object you select.
Try stuff out and see how it feels, what bugs you find etc, the dot-product test is the quickest and easiest to do (depending on what you're working in - Unity/C++) - QixExplorerThanks guys I very appreciate your help. :)
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 1 year ago
- 3 years ago