Chulein
30-09-2008 13:55:10
Hi all.
i use rays to pick objects in the 3d scene and also update the position on the field\plane where i got my cursor. it works perfecly as long i i keep the camera close to the origo(0,0,0) it seems. when i move away further than +-(20000,0,20000) the cameraray hits like a dead zone.. i mean that most of the places where i click on the field the rayquery is empty. except from center around origo(0,0,0).
the scene is a empty 3d space with a field thats made of a plane.mesh. more like a beginning of an editor.
from a 2d viewpoint:
when the camera is inside the red box i can update the fieldposition and pick an object i want on the field.
but!.
when im outside of this "area" the raypick returns 0 hits on the field. its only has a "working area" around the origo.
code i am using.
has anybody seen anything like this?
thanks
Chulein
i use rays to pick objects in the 3d scene and also update the position on the field\plane where i got my cursor. it works perfecly as long i i keep the camera close to the origo(0,0,0) it seems. when i move away further than +-(20000,0,20000) the cameraray hits like a dead zone.. i mean that most of the places where i click on the field the rayquery is empty. except from center around origo(0,0,0).
the scene is a empty 3d space with a field thats made of a plane.mesh. more like a beginning of an editor.
from a 2d viewpoint:
when the camera is inside the red box i can update the fieldposition and pick an object i want on the field.
but!.
when im outside of this "area" the raypick returns 0 hits on the field. its only has a "working area" around the origo.
code i am using.
float scrx = (float)e.X / Viewport.ActualWidth;
float scry = (float)e.Y / Viewport.ActualHeight;
Ray ray = mCamera.GetCameraToViewportRay(scrx, scry);
RaySceneQuery query = mSceneMgr.CreateRayQuery(ray);
RaySceneQueryResult result;
result = query.Execute();
itr = result.Begin();
has anybody seen anything like this?
thanks
Chulein