I am trying to create a vertex selection modifier for a 3D chart that would allow me to select everything within two points on an axis. I have inherited from ChartModifierBase and created overrides for the OnModifierMouse events but I need a way to calculate the world or data coordinate of my axis. I know that CameraController has a ScreenToWorldSpace method but this is not exposed on the Camera3D class. Currently I have resorted to calling the TSRCamera’s TransformIntoWorldCoordinates method but would prefer a less roundabout solution. Is there an easier way to calculate screen to world/data coordinates or a way to get the position on my axis from screen coordniates?
Thanks for your inquiry.
There is no way to detect clicks on the Axis3D out of the box because we do not report the 3D world coordinates of the Axis.
However, there is a way to convert World to Screen coordinates. Please take a look:
/// <summary>Converts the Vector3 in world space to a 2D screen coordinate, using the current View and Projection matrices</summary> Point WorldToScreenSpace(Vector3 vertex); /// <summary>Converts the Vector3 in world space to a 2D screen coordinate, using the current View and Projection matrices</summary> Point LocalCoordinateToScreenSpace(Vector3 vertex);
Also, if you know the VisibleRange of your Axis you can possibly use this to calculate the pixel area of an Axis approximately.
Hope this helps.
With best regards,
Please login first to submit.