Plane |
public void AlignWithCamera( ProjectionCamera wpfCamera )
AlignWithCamera method aligns the PlaneVisual3D to be oriented so that it faces the specified camera.
When many PlaneVisual3D objects need to be aligned with the camera, then it is better to use the following code to align all the planes (this way the GetCameraPlaneOrientation method is called only once):
Vector3D planeNormalVector3D, widthVector3D, heightVector3D; Ab3d.Cameras.BaseCamera.GetCameraPlaneOrientation(wpfCamera, out planeNormalVector3D, out widthVector3D, out heightVector3D); for(int i = 0; i < planes.Count; i++) // Use for instead of foreach to prevent creating Enumerator object { var onePlaneVisual3D = planes[i]; onePlaneVisual3D.BeginInit(); onePlaneVisual3D.Normal = planeNormalVector3D; onePlaneVisual3D.HeightDirection = heightVector3D; onePlaneVisual3D.EndInit(); }