Hello,
Using View3D with a SurfaceGridSeries3D with mouse wheel zooming. When the mouse wheel is used to zoom, the zoom is always done relative to the center. Is there any option to allow the zoom to be done at the mouse location?
In the screen shot below, I would like to zoom in on the area circled in red, however I can not seem to, zooming is done to the center, as shown in second screen shot.
Thanks
View3D SurfaceGridSeries3D zoom - always zoom to center
Moderator: Queue Moderators
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: View3D SurfaceGridSeries3D zoom - always zoom to center
Hi,
the mouse wheel zoom is using View3D.Camera.Target as center point. Obviously if you change the Target, it will not just change the zooming center, but center the view in that as well.
the mouse wheel zoom is using View3D.Camera.Target as center point. Obviously if you change the Target, it will not just change the zooming center, but center the view in that as well.
LightningChart Support Team, PT
Re: View3D SurfaceGridSeries3D zoom - always zoom to center
Hi,
Is there an event that gets fired for the zoom? So that I can set the camera target before the zoom is done?
Is there an event that gets fired for the zoom? So that I can set the camera target before the zoom is done?
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: View3D SurfaceGridSeries3D zoom - always zoom to center
I think you can use m_chart.View3D.CameraViewChanged:
Then the camera target to latest tracked point in the surface (stored here in m_mouseTrackLabel.TargetAxis.Values). It looks a little bit awkward because it really jumps there, and also updates the mouse cursor position on the screen.
Code: Select all
void View3D_CameraViewChanged(Camera3D newCameraViewPoint, View3D view, LightningChartUltimate chart)
{
m_chart.BeginUpdate();
m_chart.View3D.CameraViewChanged -= View3D_CameraViewChanged;
PointDouble3D p = m_chart.View3D.ConvertSeriesValueTo3DWorldCoord(m_surface, m_mouseTrackLabel.TargetAxisValues.X, m_mouseTrackLabel.TargetAxisValues.Y, m_mouseTrackLabel.TargetAxisValues.Z);
m_chart.View3D.Camera.Target.SetValues((float)p.X, (float)p.Y, (float)p.Z);
m_chart.View3D.CameraViewChanged += View3D_CameraViewChanged;
m_chart.EndUpdate();
Cursor.Position = m_chart.PointToScreen(new Point(m_chart.ClientSize.Width / 2, m_chart.ClientSize.Height / 2));
}
LightningChart Support Team, PT