SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components

0
0

Hi all,

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

Version
6.2
  • You must to post comments
0
0

Hi Nathan,

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,
Oleksandr

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.