ImageGear .NET - Updated July 5, 2018
Orbit
User Guide > How to Work with... > CAD > How To ... > Manipulate View Using a Camera > Orbit

The orbit function in the CADCamera class allows users to move the camera on a plane by a given angle, while looking at and keeping the same distance from a set point.

The CADViewer sample demonstrates this functionality. See Samples.

The following Orbit sample illustrates how you use the orbit function to rotate around horizontal and vertical axes:

C#
Copy Code
using System.IO;
using ImageGear.Formats;
using ImageGear.Formats.CAD;

public static void CameraOrbit(string path, double radX, double radY)
{
    ImGearCADPage page = null;

    // Load the file.
    using (FileStream fileStream = new FileStream(path, FileMode.Open, FileAccess.Read))
    {
        page = (ImGearCADPage)ImGearFileFormats.LoadPage(fileStream);
    }

    // Orbit the camera
    page.Camera.Orbit(radX, radY);
}