I'm trying to create a Hololens application using UrhoSharp and am confused by the following line of code:
var ray = LeftCamera.GetScreenRay(0.5f, 0.5f);
The resource I'm using claims the two floats are "normalized screen coordinates" but I don't understand what this means in 3D. I believe it's creating a ray whose origin is at the origin of "LeftCamera", but pointing in what XYZ direction? Any help clearing this up is greatly appreciated. Thanks in advance!
-L
The direction of the ray is the exact direction you are pointing the camera (for some or most platforms, this is the direction you are looking, if looking along the +z axis, that is the direction. If looking up, along +y, that is the direction. So the direction is the direction of the camera that is sourcing the ray).
You're making this more complicated than it needs to be. Use raycasting a few times and it will simplify itself.
Answers
The coordinates of the screen are from 0 to 1 in up/down and left/left right.
That code is saying shoot the ray into the center of the view.
Thanks, but just to be clear:
1) What is the origin of the ray?
2) Is the ray identical (same origin and direction) to one from "RightCamera.GetScreenRay(0.5f,0.5f)"?
The direction of the ray is the exact direction you are pointing the camera (for some or most platforms, this is the direction you are looking, if looking along the +z axis, that is the direction. If looking up, along +y, that is the direction. So the direction is the direction of the camera that is sourcing the ray).
You're making this more complicated than it needs to be. Use raycasting a few times and it will simplify itself.
Great, thank you!