Pre loader

SciChart 3D: How to get screen to world/data coordinates

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

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.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies