ImageGear .NET v24.12 - Updated
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);
}
VB.NET
Copy Code
Imports System.IO
Imports ImageGear.Formats
Imports ImageGear.Formats.CAD

Public Sub CameraOrbit(path As String, radX As Double, radY As Double)
    Dim page As ImGearCADPage

    ' Load the file.
    Using fileStream As New FileStream(path, FileMode.Open, FileAccess.Read)
        page = ImGearFileFormats.LoadPage(fileStream)
    End Using

    '  Orbit the camera
    page.Camera.Orbit(radX, radY)
End Sub