AGI Components with Insight3D Alpha 2008 r8
Adding Insight3D to Existing Applications

The quickest way to use Insight3D in new applications is to use the QuickStart application. If you'd like to add Insight3D to an existing application, follow the steps outlined below.

Topic Description
Add references Add references to the 3D control, Insight3D assemblies, and DGL assemblies.
Initialize data Add initilization code to your application's Program.Main to direct Insight3D and DGL to data.
Create post-build event Add an event to create a manifest for your application and copy Insight3D assemblies.


Add references
  • Copy the Assemblies folder from the Insight3D install to a location of your choice. In this example, it will be in the same folder as your application's .csproj file.
  • Open your project in Visual Studio.

Add a reference to the 3D control

  • Open the form you'd like to add the Insight3D 3D Control to.
  • From the view menu, select Toolbox.
  • Right click in the Toolbox and select Choose Items...
  • Click Browse, and then select AGI.UI.Controls.Graphics.dll in the Assemblies folder.
  • Click Open, then OK.
  • Select Control3D in the Toolbox and add the control to your form.
  • Your project should now have a reference to AGI.UI.Controls.Graphics as shown below.

Add references to the rest of Insight3D

  • In the Solution Explorer, right click on References and select Add Reference...
  • Select the Browse tab and browse to the Assemblies folder.
  • Select the files that match the wildcard: AGI.Graphics*.dll.
  • In addition, select AGI.UI.Controls.Graphics.Interop.dll.
  • Click OK.
  • Your project should now have references to the Insight3D assemblies shown in the image below.

Add references to DGL

  • In the Solution Explorer, right click on References and select Add Reference...
  • Select the Browse tab and browse to the Assemblies folder.
  • Select the following files
    • AGI.Foundation.Core.dll
    • AGI.Foundation.Models.dll
    • AGI.Foundation.Terrain.dll
  • Click OK.
  • You have now added all the required references as shown in the image below.

  • Save your progress.
Initialize data

Insight3D applications require a minimal set of data, such as a texture for the globe and EOP data for transformations. Insight3D comes with example data you can use in your application.

  • Copy the Examples/Insight3D/Data folder from the Insight3D install to a location of your choice. In this example, we will place the data in the same folder as your application's .csproj file.
  • Open the QuickStart example. It is located in the Insight3D install under Examples/Insight3D/QuickStart/QuickStart.csproj.
  • Open Program.cs in the QuickStart. The method Program.Main contains all the initialization required for Insight3D.
  • Open your application's Program.cs.
  • Copy the using directives from the QuickStart's Program.cs to your application's Program.cs.
  • Copy the initialization code and string constants from the QuickStart's Program.Main into your application's Program.Main. You may have to modify the dataPath constant to ensure the data is found. In this example, the first "../" should be removed.


  • Tip: The majority of data and initialization code is optional as described in the code comments in Program.Main. Based on your application's requirements, it is recommended to remove unneeded data and initialization code to minimize your application's install size.

  • Verify your application compiles.
  • Save your progress.
Create post-build event

The final step is to add a post-build step that creates a manifest file for your application and copies Insight3D assemblies to your output directory. This allows Insight3D to run without registration that is traditionally required by COM components.

  • Return to the QuickStart example in Visual Studio.
  • Right click on the project and select Properties.
  • Select the Build Events tab.
  • Copy all the text in the Post-build event to the clipboard.
  • Return to your application, and bring up the project's Properties, then select the Build Events tab.
  • Paste the text from the QuickStart into the Post-build event. You may have to modify the first line. In this example, remove "..\..\..\" immediately after the equals sign.

Run your application. A 3D window should now appear on your form.