Object Picking in WebVR based application — Oculus
Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums may be revoked at the discretion of Oculus staff.

Object Picking in WebVR based application

Hey guys,

I am developing an web-application that uses WebVR (DK1) to achieve vr ability in browsers. I would like to pick objects by my line-of-sight (looking at them). Traditional object picking via ray casting is already implemented, but I don't know which values are necessary for x and y, in the past it was the mouse:
Vector3f origin = unproject(x, y, 0, viewportWidth, viewportHeight, modelView);
Vector3f direction = unproject(x, y, 1, viewportWidth, viewportHeight, modelView).sub(origin);
Ray ray = new Ray(origin, direction);
// process intersections

Comments

Sign In or Register to comment.