I'm implementing draggable object in XML3D and i need a help with xml3d.generateRay function, as an argument it takes two numbers, as I understand correctly those are x,y coordinates of point in projection space that ray passes through. But are those coordinates in reference to the window element (left-top corner of the browser window) or to the xml upper-left corner?
Second question: how can I get hit point from getElementByRay
Specification says differently for different versions - and since there is no spec for 4.9 I ask.
The coordinates are given in window space, so relative to the top left corner of the window.
You can get the hit point and hit normal from
getElementByRayby passing twoXML3DVec3objects into the function, eg:The function will fill the vectors with the hit point and normal in world space.