There is a cube placed at the center of a scene. And I have to build a projection of a point to the surface of cube which is rotated (to build a Line from a Point to the surface at a right angle)? Do you have any ideas how i can do this?
The point is going to be placed randomly. I know that i may use Roycaster for that, but I don’t know how i can do this.
Could probably be done with either Raycaster or some vector magic - could you specify what kind of projection though? Maybe a sketch / visualisation, how you pick the point, how is it placed relative to the cube and camera.
For example:
there must be a case when it’s possible to build a projection. for example, the cube is located at origin, it has a size (6, 6, 6) and the point is at (2, 8, 2) (i hope it’s correct).
So point’s projection with right angle on the positive Y-axis (top) side will be [2, 3, 2].
But I agree with @mjurczyk, that there are places, where you won’t get projection with right angle to any side of the cube at all.