I have two 3D charts, and I would like to synchronize their camera views. This means that when I zoom, rotate, or pan in one of them, I want the other chart to update its camera settings accordingly.
To accomplish this, I am utilizing the CameraViewChanged event as follows:
Code: Select all
chartA.View3D.CameraViewChanged += View3D_CameraViewChanged;
chartB.View3D.CameraViewChanged += View3D_CameraViewChanged;w
private void View3D_CameraViewChanged(Camera3D newCameraViewPoint, View3D view, LightningChart chart)
{
var otherChart = chart == chartA ? chartB : chartA;
// update only the not focused chart
if(! otherChart.IsFocused)
{
otherChart.View3D.Camera.RotationX = newCameraViewPoint.RotationX;
otherChart.View3D.Camera.RotationY = newCameraViewPoint.RotationY;
otherChart.View3D.Camera.RotationZ = newCameraViewPoint.RotationZ;
otherChart.View3D.Camera.Target = newCameraViewPoint.Target;
otherChart.View3D.Camera.ViewDistance = newCameraViewPoint.ViewDistance;
}
}
Can you please assist me with this issue?
Thank you.