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:
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
