Hi. I need to put an object in space relative to the position of the mouse on the screen. screenToWorld is not suitable because it returns the position relative to the terrain. Is it possible to somehow get the mouse position through positionCameraToWorld?
So far, I'm stuck on this piece of code:
_startASL = agltoasl ( positionCameraToWorld [ 0,0,0 ] ) ;
getMousePosition params ["_xpos","_ypos"];
_Xoffset = _xpos;
_Yoffset = - _ypos;
_Zoffset = 10; //Depending on z, the x and y offset will be different. The position relative to the mouse is best seen in small _Zoffset values, but it is still inaccurate
_endASL = agltoasl ( positionCameraToWorld [ _Xoffset,_Yoffset,_Zoffset ] ) ;
_ins = lineIntersectsSurfaces [ _startASL , _endASL , player , objNull , true , 1 , "VIEW" , "NONE" ] ;
I think I need to use FOV, angles, extra vectors or something like that. But I have no idea how to do it and my math skills are bad. Please help me!!!