Archive for July, 2009

Favorite Features: Display Conditions

Hi, my name is Alex Rybak.  I'm currently an intern at AGI, and I have been working on the Insight3D team ever since I started here.  I've had an interest in 3D graphics for a while, and working on Insight3D has given me a lot of opportunities to explore that area.  Aside from my internship here, I am a full-time student at Drexel University, where I am studying for both a B.S. and an M.S. degree in Computer Science.


Display conditions are a very useful Insight3D feature that allow the user to specify when a primitive, globe overlay, or screen overlay is rendered.  There are a number of different types of display conditions that can be used, and what's even better is that they can be combined and used together to create fancy rules for when to display an object.  In this article, I will show some example uses of display conditions.

To start off, let's say we want to display a circle on the Earth around New York City when the camera is at an altitude of one million meters or less.  For this, we assign the AltitudeDisplayCondition (which becomes active when the camera's altitude above the surface is within a specified interval) to a PolyLinePrimitive.   Here is the code:

CentralBody earth = CentralBodiesFacet.GetFromContext().GetByName("Earth");
Cartographic newYork = new Cartographic(Trig.DegreesToRadians(-74), Trig.DegreesToRadians(40.75), 0);
SurfaceShapesResult shape = SurfaceShapes.ComputeCircleCartographic(earth, newYork, 10000);

PolylinePrimitive line = new PolylinePrimitive(shape.PolylineType, SetHint.Infrequent);
line.Color = Color.White;

AltitudeDisplayCondition condition = new AltitudeDisplayCondition(0, 1000000);
line.DisplayCondition = condition;


As you can see in the images below, the circle is visible only when the camera is below this altitude.



Matlab with Insight3D

Over at the Dynamic Geometry Library Blog, Ted Driver explains how to use Insight3D and other AGI Components in Matlab.

Favorite Features: The Marker Batch Primitive

This is the first of a series of articles about our favorite features in Insight3D written by developers on the Insight3D team, the AGI Components team, and other AGI developers that we've deemed as world experts in Insight3D.

I like lots of Insight3D features, but I've decided to write about the marker batch primitive because 1) I developed it and am therefore biased, and 2) it does lots of fancy things under the hood for performance.

Marker Batch Basics

Loosely speaking, markers are 2D images that always face the viewer, like these arrows:


Yes, I drew the arrow icon myself  in Visual Studio, and no, I've never thought of a career in art.  Markers are sometimes called Sprites or Billboards.  They have an incredible number of uses:  representing points of interest, visualizing a ton of realtime data, replacing 3D models to improve performance, and for rendering image-based effects such as clouds, smoke, fire, and vapor trails.  Of course, we are looking for an excuse to code up some of these effects, so please leave a comment if you are interested.