<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>AGI Graphics Team Blog</title>
	<atom:link href="http://blogs.agi.com/insight3d/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.agi.com/insight3d</link>
	<description>Thoughts on GFX</description>
	<lastBuildDate>Fri, 26 Feb 2010 19:01:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>New in AGI Components 2010 r1</title>
		<link>http://blogs.agi.com/insight3d/index.php/2010/01/26/new-in-agi-components-2010-r1/</link>
		<comments>http://blogs.agi.com/insight3d/index.php/2010/01/26/new-in-agi-components-2010-r1/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 04:45:47 +0000</pubDate>
		<dc:creator>Cozzi</dc:creator>
				<category><![CDATA[Developer]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Primitives]]></category>

		<guid isPermaLink="false">http://blogs.agi.com/insight3d/?p=699</guid>
		<description><![CDATA[The first AGI Components release for 2010 is now available on ADN.  This release includes the solid primitive:  a new primitive for visualizing solids such as ellipsoids and boxes, as shown below.

A new overview, available in our online help, explains how to use the solid primitive, including using visual cues such as the white silhouette [...]]]></description>
			<content:encoded><![CDATA[<p>The first AGI Components release for 2010 is now available on <a title="ADN" href="http://adn.agi.com/detailedView.cfm?resourceId=240">ADN</a>.  This release includes the solid primitive:  a new primitive for visualizing solids such as ellipsoids and boxes, as shown below.</p>
<p><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2010/01/Ellipsoid.jpg"><img class="alignnone size-full wp-image-703" title="Ellipsoid" src="http://blogs.agi.com/insight3d/wp-content/uploads/2010/01/Ellipsoid.jpg" alt="Ellipsoid" width="486" height="314" /></a></p>
<p>A new overview, available in our <a title="online help" href="http://www.agi.com/resources/help/online/AGIComponents/source/Programmer%27s%20Guide/Overview/Graphics/Primitives/Solid.html">online help</a>, explains how to use the solid primitive, including using visual cues such as the white silhouette edge and removal of back facing lines shown above.  The polyline and point batch primitive now have an optional outline with a unique size, color, and translucency.  This small feature adds a nice visual cue:</p>
<p><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2010/01/Polyline.jpg"><img class="alignnone size-full wp-image-701" title="Polyline" src="http://blogs.agi.com/insight3d/wp-content/uploads/2010/01/Polyline.jpg" alt="Polyline" width="486" height="174" /></a></p>
<p>Download AGI Components 2010 r1 from <a title="ADN" href="http://adn.agi.com/detailedView.cfm?resourceId=240">ADN</a> and give these new features a try.</p>
 <img src="http://blogs.agi.com/insight3d/wp-content/plugins/feed-statistics.php?view=1&post_id=699" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blogs.agi.com/insight3d/index.php/2010/01/26/new-in-agi-components-2010-r1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Trapezoidal Texture Projection with OpenGL</title>
		<link>http://blogs.agi.com/insight3d/index.php/2009/11/20/trapezoidal-texture-projection-with-opengl/</link>
		<comments>http://blogs.agi.com/insight3d/index.php/2009/11/20/trapezoidal-texture-projection-with-opengl/#comments</comments>
		<pubDate>Sat, 21 Nov 2009 01:15:08 +0000</pubDate>
		<dc:creator>deron</dc:creator>
				<category><![CDATA[Graphics Developer]]></category>

		<guid isPermaLink="false">http://blogs.agi.com/insight3d/?p=667</guid>
		<description><![CDATA[
All surface images in Insight3D are placed on the Earth where the edges of the image align with latitudinal and longitudinal lines and the top edge is north.&#160; Several customers have asked if they could map an image where that is not the case, where they have the latitude and longitude coordinates of each corner.
Fig. [...]]]></description>
			<content:encoded><![CDATA[<p><em></em></p>
<p>All surface images in Insight3D are placed on the Earth where the edges of the image align with latitudinal and longitudinal lines and the top edge is north.&#160; Several customers have asked if they could map an image where that is not the case, where they have the latitude and longitude coordinates of each corner.</p>
<p>Fig. 1 shows an image captured from the viewpoint of a simulated UAV camera.&#160; While the image itself is exactly as it was, the image is not correctly positioned on the terrain.&#160; As mentioned, the image edges align with latitudinal and longitudinal lines.&#160; </p>
<table cellspacing="0" cellpadding="2" width="504" border="0">
<tbody>
<tr>
<td valign="top" width="502"><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2009/11/trapezoidNotRotated.png"><img title="trapezoidNotRotated" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="402" alt="trapezoidNotRotated" src="http://blogs.agi.com/insight3d/wp-content/uploads/2009/11/trapezoidNotRotated_thumb.png" width="502" border="0" /></a> </td>
</tr>
<tr>
<td align="center" width="502"><strong>Fig. 1</strong></td>
</tr>
</tbody>
</table>
<p>In fig. 2, the image’s corners have been mapped from their original coordinates to their actual coordinates. One can tell that the camera took this image from the southwest. </p>
<table cellspacing="0" cellpadding="2" width="502" border="0">
<tbody>
<tr>
<td valign="top" width="502"><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2009/11/trapezoidRotated.png"><img title="trapezoidRotated" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="402" alt="trapezoidRotated" src="http://blogs.agi.com/insight3d/wp-content/uploads/2009/11/trapezoidRotated_thumb.png" width="502" border="0" /></a> </td>
</tr>
<tr>
<td align="center" width="502"><strong>Fig. 2</strong></td>
</tr>
</tbody>
</table>
<p>This capability has been added to Insight3D’s&#160; <a href="http://www.agi.com/resources/help/online/AGIComponents/source/Programmer%27s%20Guide/Overview/Graphics/Primitives/SurfaceMesh.html">Surface Mesh Primitive</a> for our upcoming r8 release.&#160; I’ll wait until r8 is out to discuss the new interfaces and how this method differs from <a href="http://www.agi.com/resources/help/online/AGIComponents/source/Programmer%27s%20Guide/Overview/Graphics/Imaging/RasterStream.html">projecting an image onto the terrain</a>.</p>
<p>In this post, I’ll discuss how we use <a href="http://www.opengl.org">OpenGL</a> to remap the image of fig. 1 to that of fig. 2.</p>
<p> <span id="more-667"></span><br />
<h3>Perspective Texture Projection</h3>
<p>The goal is to remap the texture coordinates from one trapezoid to another.&#160; Let’s begin with an example.&#160; Fig 3a shows an image, a blue square with a red border, mapped to a square, while the other figures show a remapping of that square to a trapezoid with an outline of the original square shown as reference.</p>
<table cellspacing="0" cellpadding="0" width="502" border="0">
<tbody>
<tr>
<td valign="top" width="502"><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2009/11/comparison.png"><img title="comparison" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="166" alt="comparison" src="http://blogs.agi.com/insight3d/wp-content/uploads/2009/11/comparison_thumb.png" width="498" border="0" /></a> </td>
</tr>
<tr>
<td width="502">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; a. Original&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; b. Orthographic&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; c. Perspective</td>
</tr>
<tr>
<td align="center" width="502"><strong>Fig. 3</strong></td>
</tr>
</tbody>
</table>
<p>One obvious way to map to the trapezoid would be to just move the vertices.&#160; In fig 3b, the vertex positions have been moved while the texture coordinates remain that same as in fig 3a.&#160; This results in an orthographic projection where the texture coordinates are linearly interpolated across the trapezoid.&#160; Given that we want a perspective projection, this is incorrect.</p>
<p>In fig 3c, the vertex positions have been moved, and the texture coordinates have been altered.&#160; This trapezoid appears to be a rectangle closer to the viewer on the left side and farther away on the right; however,&#160; the trapezoid is actually in a plane perpendicular to the viewer, i.e. flat to your display.&#160; A perspective transform has been applied to the texture coordinates.&#160; This is how the UAV image should be placed onto the terrain.&#160; How is this transform computed?</p>
<h3>The Texture Matrix</h3>
<p>A texture coordinate is defined by the vector (s, t, r,&#160; q).&#160; Most graphics developers are familiar with using s and t to map a 2D texture to a triangle; in this case, r and q default to 0 and 1 respectively.&#160; The value r is used for 3D textures and so is ignored here.&#160; I’ll get to q in a moment.</p>
<p>In the OpenGL fixed function pipeline, each texture coordinate (s, t, r,&#160; q) is multiplied by a <a href="http://glprogramming.com/red/chapter09.html#name17">4x4 texture matrix</a> as shown in eq. 1.</p>
<table cellspacing="0" cellpadding="0" width="504" border="0">
<tbody>
<tr>
<td align="center" width="504"><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2009/11/trapezoidEq0.png"><img title="trapezoidEq0" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="120" alt="trapezoidEq0" src="http://blogs.agi.com/insight3d/wp-content/uploads/2009/11/trapezoidEq0_thumb.png" width="271" border="0" /></a> </td>
</tr>
<tr>
<td align="center" width="504"><strong>Eq. 1</strong></td>
</tr>
</tbody>
</table>
<p>Since OpenGL interprets (s’, t’, r’, q’) as a <a href="http://en.wikipedia.org/wiki/Homogeneous_coordinates">homogeneous coordinate</a>, s’, t’,&#160; and r’ are next divided by q’ as shown in eqs. 2, 3 and 4.&#160; This is the perspective divide, and is necessary to produce fig 3c.</p>
<table cellspacing="0" cellpadding="2" width="504" border="0">
<tbody>
<tr>
<td align="center" width="504"><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2009/11/trapezoidEq3.png"><img title="trapezoidEq3" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="88" alt="trapezoidEq3" src="http://blogs.agi.com/insight3d/wp-content/uploads/2009/11/trapezoidEq3_thumb.png" width="108" border="0" /></a> </td>
</tr>
<tr>
<td align="center" width="504"><strong>Eqs. 2, 3, 4</strong></td>
</tr>
</tbody>
</table>
<p>Coordinate (s’’, t’’, r’’) is used to sample the texture.&#160; For a 2D texture, only s’’ and t’’ are used.</p>
<h3>Computing the Texture Matrix</h3>
<p>Remapping requires a texture matrix that maps (s, t) in fig 3c to (s’’, t’’) in fig. 3a.</p>
<p>Since only a 2D texture is being considered, the 3D components of the matrix and vectors are zeroed out; m<sub class="sub">44</sub> is set to 1 as this is a homogenous matrix; m<sub class="sub">33</sub> is inconsequential as that value is multiplied by 0 in the matrix multiplication.</p>
<p><strong></strong></p>
<table cellspacing="0" cellpadding="2" width="504" border="0">
<tbody>
<tr>
<td align="center" width="504"><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2009/11/trapezoidEq1.png"><img title="trapezoidEq1" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="121" alt="trapezoidEq1" src="http://blogs.agi.com/insight3d/wp-content/uploads/2009/11/trapezoidEq1_thumb.png" width="260" border="0" /></a> </td>
</tr>
<tr>
<td align="center" width="504"><strong>Eq. 5</strong></td>
</tr>
</tbody>
</table>
<p>After multiplication,</p>
<table cellspacing="0" cellpadding="2" width="504" border="0">
<tbody>
<tr>
<td align="center" width="504"><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2009/11/trapezoidEq678.png"><img title="trapezoidEq678" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="88" alt="trapezoidEq678" src="http://blogs.agi.com/insight3d/wp-content/uploads/2009/11/trapezoidEq678_thumb.png" width="226" border="0" /></a> </td>
</tr>
<tr>
<td align="center" width="504"><strong>Eqs. 6, 7 , 8</strong></td>
</tr>
</tbody>
</table>
<p>After multiplying both sides of eqs. 2 and 3 by q’, and then plugging in eqs. 6, 7, and 8,</p>
<table cellspacing="0" cellpadding="2" width="504" border="0">
<tbody>
<tr>
<td align="center" width="504"><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2009/11/trapezoidEq910.png"><img title="trapezoidEq910" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="63" alt="trapezoidEq910" src="http://blogs.agi.com/insight3d/wp-content/uploads/2009/11/trapezoidEq910_thumb.png" width="398" border="0" /></a> </td>
</tr>
<tr>
<td align="center" width="504"><strong>Eqs. 9, 10</strong></td>
</tr>
</tbody>
</table>
<p>Eqs. 9 and 10 are rearranged to form two linear equations.</p>
<table cellspacing="0" cellpadding="2" width="535" border="0">
<tbody>
<tr>
<td align="center" width="533"><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2009/11/trapezoidEq1112.png"><img title="trapezoidEq1112" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="64" alt="trapezoidEq1112" src="http://blogs.agi.com/insight3d/wp-content/uploads/2009/11/trapezoidEq1112_thumb.png" width="604" border="0" /></a> </td>
</tr>
<tr>
<td align="center" width="533"><strong>Eqs. 11, 12</strong></td>
</tr>
</tbody>
</table>
<p>There are eight unknown matrix components to solve.&#160;&#160; The mapping for the corners to go from figs. 3c to 3a are:</p>
<table cellspacing="0" cellpadding="0" width="504" border="0">
<tbody>
<tr>
<td align="center" width="504"><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2009/11/trapezoidFig4.png"><img title="trapezoidFig4" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="160" alt="trapezoidFig4" src="http://blogs.agi.com/insight3d/wp-content/uploads/2009/11/trapezoidFig4_thumb.png" width="208" border="0" /></a> </td>
</tr>
<tr>
<td align="center" width="504"><strong>Fig 4.</strong></td>
</tr>
</tbody>
</table>
<p>This yields eight equations with eight unknowns. Using a linear equation solver, the texture matrix can be computed.</p>
<h3>Applying the Texture Matrix</h3>
<p>If you are using the OpenGL fixed function pipeline, after loading this matrix to the <a href="http://glprogramming.com/red/chapter09.html#name17">OpenGL matrix stack</a>, there are two basic ways to render the texture and geometry.</p>
<p>You can move the vertex positions and use the (s, t) texture coordinates.</p>
<p>Alternatively, you could keep the original vertex positions and (s’’, t’’) texture coordinates.&#160; You will have to specify a border color for the texture.</p>
<pre class="csharp"><span style="color: #FF0000;">float</span> borderColor<span style="color: #000000;">&#91;</span><span style="color: #FF0000;">4</span><span style="color: #000000;">&#93;</span> = <span style="color: #000000;">&#123;</span><span style="color: #FF0000;">126</span>.0f, <span style="color: #FF0000;">126</span>.0f, <span style="color: #FF0000;">126</span>.0f, <span style="color: #FF0000;">0</span>.0f<span style="color: #000000;">&#125;</span>;
glTexParameterfv<span style="color: #000000;">&#40;</span>GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, borderColor<span style="color: #000000;">&#41;</span>;
glTexParameteri<span style="color: #000000;">&#40;</span>GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER<span style="color: #000000;">&#41;</span>;
glTexParameteri<span style="color: #000000;">&#40;</span>GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER<span style="color: #000000;">&#41;</span>;</pre>
<p>When rendering, you must enable the alpha test.</p>
<pre class="csharp">glAlphaFunc<span style="color: #000000;">&#40;</span>GL_GREATER, <span style="color: #FF0000;">0</span>.0f<span style="color: #000000;">&#41;</span>;
glEnable<span style="color: #000000;">&#40;</span>GL_ALPHA_TEST<span style="color: #000000;">&#41;</span>;</pre>
<p>If you do not, the texture will bleed beyond its border as shown in fig. 5. </p>
<table cellspacing="0" cellpadding="0" width="504" border="0">
<tbody>
<tr>
<td align="center" width="504"><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2009/11/trapezoidFig5.png"><img title="trapezoidFig5" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="166" alt="trapezoidFig5" src="http://blogs.agi.com/insight3d/wp-content/uploads/2009/11/trapezoidFig5_thumb.png" width="166" border="0" /></a> </td>
</tr>
<tr>
<td align="center" width="504"><strong>Fig. 5</strong></td>
</tr>
</tbody>
</table>
<p>Of course if you are using shaders instead of the fixed function pipeline, you can still easily do either way.&#160; There are various other combinations that will work too.</p>
<p>Our unique method for rendering the surface mesh primitive requires that we use the second method.</p>
<h3>Footnoticed</h3>
<p>Benjamin Supnik’s <a title="http://hacksoflife.blogspot.com/" href="http://hacksoflife.blogspot.com/">blog</a> posts on this topic <a title="http://hacksoflife.blogspot.com/2008/08/perspective-correct-texturing-in-opengl.html" href="http://hacksoflife.blogspot.com/2008/08/perspective-correct-texturing-in-opengl.html">here</a> and <a title="http://hacksoflife.blogspot.com/2009/11/perspective-correct-texturing-q.html" href="http://hacksoflife.blogspot.com/2009/11/perspective-correct-texturing-q.html">here</a> were very helpful.&#160; He explains much of what I have and more.&#160; Hopefully though, I have added to understanding this topic.</p>
 <img src="http://blogs.agi.com/insight3d/wp-content/plugins/feed-statistics.php?view=1&post_id=667" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blogs.agi.com/insight3d/index.php/2009/11/20/trapezoidal-texture-projection-with-opengl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Orient a Model</title>
		<link>http://blogs.agi.com/insight3d/index.php/2009/11/10/how-to-orient-a-model/</link>
		<comments>http://blogs.agi.com/insight3d/index.php/2009/11/10/how-to-orient-a-model/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 12:53:23 +0000</pubDate>
		<dc:creator>Cozzi</dc:creator>
				<category><![CDATA[Developer]]></category>
		<category><![CDATA[Primitives]]></category>

		<guid isPermaLink="false">http://blogs.agi.com/insight3d/?p=578</guid>
		<description><![CDATA[In this entry, I'll explain how to orient a model primitive using its ReferenceFrame and Orientation properties.  We'll go through two examples.  The first one orients a launch pad model on the ground:

The second example orients a satellite model in orbit:


Orienting using Reference Frames
In many cases, particularly those where a model is stationary on the [...]]]></description>
			<content:encoded><![CDATA[<p>In this entry, I'll explain how to orient a model primitive using its <a href="http://www.agi.com/resources/help/online/AGIComponents/source/html/P_AGI_Foundation_Graphics_Primitive_ReferenceFrame.htm">ReferenceFrame</a> and <a href="http://www.agi.com/resources/help/online/AGIComponents/source/html/P_AGI_Foundation_Graphics_ModelPrimitive_Orientation.htm">Orientation</a> properties.  We'll go through two examples.  The first one orients a launch pad model on the ground:</p>
<p><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2009/09/LaunchPadOrientation.jpg"><img class="alignnone size-full wp-image-592" title="LaunchPadOrientation" src="http://blogs.agi.com/insight3d/wp-content/uploads/2009/09/LaunchPadOrientation.jpg" alt="LaunchPadOrientation" width="500" height="143" /></a></p>
<p>The second example orients a satellite model in orbit:</p>
<p><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2009/09/SatelliteOrientations.jpg"><img class="alignnone size-full wp-image-626" title="SatelliteOrientations" src="http://blogs.agi.com/insight3d/wp-content/uploads/2009/09/SatelliteOrientations.jpg" alt="SatelliteOrientations" width="498" height="138" /></a></p>
<p><span id="more-578"></span></p>
<h2>Orienting using Reference Frames</h2>
<p>In many cases, particularly those where a model is stationary on the ground, a model can be oriented by simply setting its ReferenceFrame property.  The following example loads a launch pad model at Cape Canaveral.  What is going on with its default orientation?</p>
<pre class="brush: csharp; gutter: false;">
Cartographic position = new Cartographic(Trig.DegreesToRadians(-80.577778), Trig.DegreesToRadians(28.488889), 0);
ModelPrimitive model = new ModelPrimitive(&quot;delta4-lp.mdl&quot;);
model.PositionCartographic = position;
SceneManager.Primitives.Add(model);
</pre>
<p style="text-align: center;"><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2009/09/LaunchPadCBF.jpg"><img class="size-full wp-image-581 aligncenter" title="LaunchPadCBF" src="http://blogs.agi.com/insight3d/wp-content/uploads/2009/09/LaunchPadCBF.jpg" alt="LaunchPadCBF" width="359" height="316" /></a></p>
<p>Since the model primitive, like all primitives, has a default reference frame of the Earth's fixed frame.  The model is oriented using the Earth's fixed frame's axes.  In this case, the tower is aligned with +z.  How do I know that?  I used the handy ReferenceFrameGraphics helper class that is available in the HowTo:</p>
<pre class="brush: csharp; gutter: false;">
EarthCentralBody earth = CentralBodiesFacet.GetFromContext().Earth;
PointCartographic origin = new PointCartographic(earth, position);
ReferenceFrame referenceFrame = new ReferenceFrame(origin, model.ReferenceFrame.Axes);
new ReferenceFrameGraphics(referenceFrame, 45);
</pre>
<p style="text-align: center;"><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2009/09/LaunchPadCBFAxes1.jpg"><img class="size-full wp-image-582 aligncenter" title="LaunchPadCBFAxes" src="http://blogs.agi.com/insight3d/wp-content/uploads/2009/09/LaunchPadCBFAxes1.jpg" alt="LaunchPadCBFAxes" width="279" height="441" /></a></p>
<p>The ReferenceFrameGraphics object created a visualization of the primitive's reference frame's axes using the primitive's position as the origin.   If you're curious, the Earth's fixed frame with its normal origin, looks like this:</p>
<p style="text-align: center;"><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2009/09/EarthFixedFrame.jpg"><img class="size-full wp-image-594 aligncenter" title="EarthFixedFrame" src="http://blogs.agi.com/insight3d/wp-content/uploads/2009/09/EarthFixedFrame.jpg" alt="EarthFixedFrame" width="321" height="329" /></a></p>
<p>So if the model was positioned at the North Pole, it would be oriented correctly.  I'm no <a href="http://blogs.agi.com/astrogator/">rocket scientist</a> but last time I checked, no one launches from the North Pole, so we are going to stick with our current launch position and change the model's orientation.  A quick look at the <a href="http://www.agi.com/resources/help/online/AGIComponents/index.html">AGI Components documentation</a> shows that <a href="http://www.agi.com/resources/help/online/AGIComponents/source/html/T_AGI_Foundation_Geometry_AxesEastNorthUp.htm">AxesEastNorthUp</a> has the orientation we want.</p>
<p>To orient the model correctly, we create a reference frame with an origin of the model's desired position and east-north-up axes.  Note that the model's position is no longer explicitly set.  It is left as its default of Cartesian.Zero, since it is at the origin of its reference frame.</p>
<pre class="brush: csharp; gutter: false;">
EarthCentralBody earth = CentralBodiesFacet.GetFromContext().Earth;
Cartographic position = new Cartographic(Trig.DegreesToRadians(-80.577778), Trig.DegreesToRadians(28.488889), 0);
PointCartographic origin = new PointCartographic(earth, position);
Axes axes = new AxesEastNorthUp(earth, origin);
ReferenceFrame referenceFrame = new ReferenceFrame(origin, axes);
new ReferenceFrameGraphics(referenceFrame, 45);

ModelPrimitive model = new ModelPrimitive(&quot;delta4-lp.mdl&quot;);
model.ReferenceFrame = referenceFrame;
SceneManager.Primitives.Add(model);
</pre>
<p style="text-align: center;"><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2009/09/LaunchPadEastNorthUp.jpg"><img class="size-full wp-image-583 aligncenter" title="LaunchPadEastNorthUp" src="http://blogs.agi.com/insight3d/wp-content/uploads/2009/09/LaunchPadEastNorthUp.jpg" alt="LaunchPadEastNorthUp" width="400" height="273" /></a></p>
<p>Other commonly used axes include <a href="http://www.agi.com/resources/help/online/AGIComponents/source/html/T_AGI_Foundation_Geometry_AxesNorthEastDown.htm">AxesNorthEastDown</a> and <a href="http://www.agi.com/resources/help/online/AGIComponents/source/html/T_AGI_Foundation_Geometry_AxesAlignedConstrained.htm">AxesAlignedConstrained</a>.</p>
<h2>Orienting using Rotations</h2>
<p>Sometimes you don't want to use a primitive's ReferenceFrame alone to orient it.  Perhaps, you are concerned about performance, and you want several primitives to share the same ReferenceFrame; or you set the model's ReferenceFrame, but the model needs further adjustments to look right.  For these cases, use the model's <a href="http://www.agi.com/resources/help/online/AGIComponents/source/html/P_AGI_Foundation_Graphics_ModelPrimitive_Orientation.htm">Orientation</a> property.</p>
<p>Let's say we're trying to orient a satellite model defined using <a href="http://www.agi.com/resources/help/online/AGIComponents/source/html/T_AGI_Foundation_Geometry_AxesLocalVerticalLocalHorizontal.htm">AxesLocalVerticalLocalHorizontal</a>, like the "Camera -&gt; Follow an Earth orbiting satellite" example in the HowTo.  Our first attempt is probably something like:</p>
<pre class="brush: csharp; gutter: false;">
AxesLocalVerticalLocalHorizontal lvlhAxes = new AxesLocalVerticalLocalHorizontal(earth.InertialFrame, propagator.CreatePoint());
ReferenceFrame lvlhFrame = new ReferenceFrame(satellitePoint, lvlhAxes);

ModelPrimitive satellite = new ModelPrimitive(&quot;globalstar.mdl&quot;);
satellite.ReferenceFrame = lvlhFrame;
SceneManager.Primitives.Add(satellite);

// Debug code for visualizing LVLH axes
new ReferenceFrameGraphics(lvlhFrame, 25, Color.Orange);
</pre>
<p>Since we've learned the usefulness of ReferenceFrameGraphics, we created one to see the model's reference frame:</p>
<p style="text-align: center;"><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2009/09/SatelliteOne.jpg"><img class="alignnone size-full wp-image-621" title="SatelliteOne" src="http://blogs.agi.com/insight3d/wp-content/uploads/2009/09/SatelliteOne.jpg" alt="SatelliteOne" width="500" height="415" /></a></p>
<p>LVLH axes are oriented such that +Y is toward the velocity vector and +X is along the position vector.  This model was originally modeled with its solar panels spanning along the Y axis so the model's orientation is incorrect in this frame.  We really want the model to be oriented like this:</p>
<p style="text-align: center;"><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2009/09/SatelliteFour.jpg"><img class="alignnone size-full wp-image-620" title="SatelliteFour" src="http://blogs.agi.com/insight3d/wp-content/uploads/2009/09/SatelliteFour.jpg" alt="SatelliteFour" width="500" height="415" /></a></p>
<p>We need two rotations to get the satellite oriented correctly in this frame.  First let's apply a -90 degree rotation around the LVLH Y axis.  This makes the tops of the solar panels that were originally facing -Z face +X, or "up."</p>
<pre class="brush: csharp; gutter: false;">
AxesLocalVerticalLocalHorizontal lvlhAxes = new AxesLocalVerticalLocalHorizontal(earth.InertialFrame, propagator.CreatePoint());
ReferenceFrame lvlhFrame = new ReferenceFrame(satellitePoint, lvlhAxes);

EulerSequence eulerSequence = new EulerSequence(-Constants.HalfPi, 0, 0, EulerSequenceIndicator.Euler213);
UnitQuaternion invertedQuaternion = new UnitQuaternion(eulerSequence.Invert());

ModelPrimitive satellite = new ModelPrimitive(&quot;globalstar.mdl&quot;);
satellite.ReferenceFrame = lvlhFrame;
satellite.Orientation = invertedQuaternion;
SceneManager.Primitives.Add(satellite);

// Debug code for visualizing LVLH axes and axes after -90 degree rotation
UnitQuaternion quaternion = new UnitQuaternion(eulerSequence);
AxesFixedOffset rotatedAxes = new AxesFixedOffset(lvlhAxes, quaternion);
ReferenceFrame rotatedFrame = new ReferenceFrame(lvlhFrame.Origin, rotatedAxes);
new ReferenceFrameGraphics(rotatedFrame, 25, Color.White, Color.Black);
new ReferenceFrameGraphics(lvlhFrame, 15, Color.Orange);
</pre>
<p style="text-align: center;"><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2009/09/SatelliteTwo.jpg"><img class="alignnone size-full wp-image-624" title="SatelliteTwo" src="http://blogs.agi.com/insight3d/wp-content/uploads/2009/09/SatelliteTwo.jpg" alt="SatelliteTwo" width="500" height="415" /></a></p>
<p>To rotate the model, first we create an <a href="http://www.agi.com/resources/help/online/AGIComponents/source/html/T_AGI_Foundation_Coordinates_EulerSequence.htm">EulerSequence</a> with a -90 degree rotation around the Y axis.  The Euler sequence is then converted to a <a href="http://www.agi.com/resources/help/online/AGIComponents/source/html/T_AGI_Foundation_Coordinates_UnitQuaternion.htm">UnitQuaternion</a> so it can be applied to the model's Orientation property.  Note that the Euler sequence is inverted when it is converted to the quaternion.  This is because we are determining the model's orientation by working from the LVLH frame to the model's frame, e.g. world to model.  The model's Orientation property expects a quaternion that goes from the model's frame to LVLH, e.g. model to world.</p>
<p>Also note that when the -90 degree rotation around Y is applied, the axes are also rotated.  The original LVLH axes are shown above in orange, and the rotated axes are shown in white.  Look at the rotated model, what rotation around what new axis is needed to get the model facing the desired direction?   90 degrees around Z:</p>
<pre class="brush: csharp; gutter: false;">
AxesLocalVerticalLocalHorizontal lvlhAxes = new AxesLocalVerticalLocalHorizontal(earth.InertialFrame, propagator.CreatePoint());
ReferenceFrame lvlhFrame = new ReferenceFrame(satellitePoint, lvlhAxes);

EulerSequence eulerSequence = new EulerSequence(-Constants.HalfPi, 0, Constants.HalfPi, EulerSequenceIndicator.Euler213);
UnitQuaternion invertedQuaternion = new UnitQuaternion(eulerSequence.Invert());

ModelPrimitive satellite = new ModelPrimitive(&quot;globalstar.mdl&quot;);
satellite.ReferenceFrame = lvlhFrame;
satellite.Orientation = invertedQuaternion;
SceneManager.Primitives.Add(satellite);

// Debug code for visualizing LVLH axes and axes after -90 degree rotation
UnitQuaternion quaternion = new UnitQuaternion(eulerSequence);
AxesFixedOffset rotatedAxes = new AxesFixedOffset(lvlhAxes, quaternion);
ReferenceFrame rotatedFrame = new ReferenceFrame(lvlhFrame.Origin, rotatedAxes);
new ReferenceFrameGraphics(rotatedFrame, 25, Color.White, Color.Black);
new ReferenceFrameGraphics(lvlhFrame, 15, Color.Orange);
</pre>
<p style="text-align: center;"><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2009/09/SatelliteThree.jpg"><img class="alignnone size-full wp-image-623" title="SatelliteThree" src="http://blogs.agi.com/insight3d/wp-content/uploads/2009/09/SatelliteThree.jpg" alt="SatelliteThree" width="500" height="415" /></a></p>
<p style="text-align: left;">The model is now oriented correctly.  All that was required was two Euler angle rotations:  first -90 degrees around Y, then 90 degrees around Z.  Here is the final model without the rotated axes shown:</p>
<p style="text-align: center;"><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2009/09/SatelliteFour.jpg"><img class="alignnone size-full wp-image-620" title="SatelliteFour" src="http://blogs.agi.com/insight3d/wp-content/uploads/2009/09/SatelliteFour.jpg" alt="SatelliteFour" width="500" height="415" /></a></p>
<p>In summary, use a model's ReferenceFrame and Orientation property to get it oriented the way you want it.  When in doubt, experiment using ReferenceFrameGraphics to help visualize what is happening.</p>
 <img src="http://blogs.agi.com/insight3d/wp-content/plugins/feed-statistics.php?view=1&post_id=578" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blogs.agi.com/insight3d/index.php/2009/11/10/how-to-orient-a-model/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>New in AGI Components 2009 r7:  Primitives in any Reference Frame</title>
		<link>http://blogs.agi.com/insight3d/index.php/2009/11/06/new-in-agi-components-2009-r7-primitives-in-any-reference-frame/</link>
		<comments>http://blogs.agi.com/insight3d/index.php/2009/11/06/new-in-agi-components-2009-r7-primitives-in-any-reference-frame/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 16:43:41 +0000</pubDate>
		<dc:creator>Cozzi</dc:creator>
				<category><![CDATA[Developer]]></category>
		<category><![CDATA[Primitives]]></category>

		<guid isPermaLink="false">http://blogs.agi.com/insight3d/?p=560</guid>
		<description><![CDATA[I'm excited to announce that we just released 2009 r7, which includes the ability to define primitives in any reference frame.  Previously, primitives could only be defined in a central body's fixed or inertial frame.   Now, instead of converting from the reference frame of your data to the primitive's reference frame, you can just set [...]]]></description>
			<content:encoded><![CDATA[<p>I'm excited to announce that we just released <a href="http://adn.agi.com/detailedView.cfm?resourceId=240">2009 r7</a>, which includes the ability to define primitives in any reference frame.  Previously, primitives could only be defined in a central body's fixed or inertial frame.   Now, instead of converting from the reference frame of your data to the primitive's reference frame, you can just set the primitive's <a href="http://www.agi.com/resources/help/online/AGIComponents/source/html/P_AGI_Foundation_Graphics_Primitive_ReferenceFrame.htm">ReferenceFrame</a> property to the same reference frame of your data.  Doing this is almost always more efficient and easier to code!  What's even better is if the reference frame varies with time, the primitive will move during animation automatically.</p>
<p style="text-align: center;"><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2009/09/Facility.jpg"><img class="size-full wp-image-562 aligncenter" title="Facility" src="http://blogs.agi.com/insight3d/wp-content/uploads/2009/09/Facility.jpg" alt="Facility" width="400" height="322" /></a></p>
<p><span id="more-560"></span></p>
<p>Make sure to check out the "Primitives -&gt; Model -&gt; Orient a model" example in the HowTo.  It was updated to use a reference frame based on the model's position and east-north-up axes.  This means the model's position can just be Cartesian.Zero, which is its default.  The model's orientation no longer needs to be set since the model is orientated appropriately in this reference frame as shown above.</p>
<p>The other HowTo example to check out is "Camera -&gt; Follow an Earth orbiting satellite."  The model's reference frame is now based on the <a href="http://www.agi.com/resources/help/online/AGIComponents/source/html/T_AGI_Foundation_Propagators_Sgp4Propagator.htm">Sgp4Propagator</a> used to propagate the satellite.  This means the model's position is no longer manually set when the animation time changes.</p>
<p style="text-align: center;"><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2009/09/Satellite.jpg"><img class="size-full wp-image-565   aligncenter" title="Satellite" src="http://blogs.agi.com/insight3d/wp-content/uploads/2009/09/Satellite.jpg" alt="Satellite" width="383" height="338" /></a></p>
<p>The reference frame axes shown in the above two images are visualized using a helper class in the HowTo:  ReferenceFrameGraphics.  Its constructor simply takes the reference frame you want to visualize and the length to make the axes.  I'm sure you will find this a useful visualization and debugging tool.</p>
<h2>Best Practices</h2>
<p>To close this entry, here are a few best practices for using reference frames with primitives.</p>
<ul>
<li>Avoid manually converting lots of data between reference frames for use with primitives.  For example, if you have 10,000 points to visualize with <a href="http://www.agi.com/resources/help/online/AGIComponents/source/html/T_AGI_Foundation_Graphics_PointBatchPrimitive.htm">PointBatchPrimitive</a>, set the primitive's ReferenceFrame property appropriately, instead of converting the points manually.  This is especially true if the points are moving and the manual conversion would have to be done over and over again.</li>
<li>Avoid using tons of reference frames for visualization.  There is a small, fixed amount of rendering overhead per reference frame.  This will only become an issue if a lot of primitives are created, each with their own unique reference frame.  For example, it is more efficient to create 1,000 model primitives with the same reference frame and set their <a href="http://www.agi.com/resources/help/online/AGIComponents/source/html/P_AGI_Foundation_Graphics_ModelPrimitive_Position.htm">Position</a> and <a href="http://www.agi.com/resources/help/online/AGIComponents/source/html/P_AGI_Foundation_Graphics_ModelPrimitive_Orientation.htm">Orientation</a> properties than to create the same models, each with a unique reference frame to position and orientate them.  This is especially true if the models aren't moving in the common reference frame.</li>
<li>Use ReferenceFrameGraphics to visualize your reference frames, especially during debugging or to help orientate a model.</li>
</ul>
 <img src="http://blogs.agi.com/insight3d/wp-content/plugins/feed-statistics.php?view=1&post_id=560" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blogs.agi.com/insight3d/index.php/2009/11/06/new-in-agi-components-2009-r7-primitives-in-any-reference-frame/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AGI Components 2009r6 is Out</title>
		<link>http://blogs.agi.com/insight3d/index.php/2009/10/09/agi-components-2009r6-is-out/</link>
		<comments>http://blogs.agi.com/insight3d/index.php/2009/10/09/agi-components-2009r6-is-out/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 18:12:58 +0000</pubDate>
		<dc:creator>deron</dc:creator>
				<category><![CDATA[Developer]]></category>
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blogs.agi.com/insight3d/?p=634</guid>
		<description><![CDATA[Download the latest version of Insight3D, part of AGI Components. Check out what is new and fixed.
 ]]></description>
			<content:encoded><![CDATA[<p><a href="http://adn.agi.com/detailedView.cfm?resourceId=240">Download</a> the latest version of <a href="http://www.Insight3d.com">Insight3D</a>, part of <a href="http://www.stk.com/products/components/">AGI Components</a>. Check out what is <a href="http://www.agi.com/resources/help/online/AGIComponents/index.html?page=source%2FWhatsNew.html">new and fixed</a>.</p>
 <img src="http://blogs.agi.com/insight3d/wp-content/plugins/feed-statistics.php?view=1&post_id=634" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blogs.agi.com/insight3d/index.php/2009/10/09/agi-components-2009r6-is-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Insight3D and Qt</title>
		<link>http://blogs.agi.com/insight3d/index.php/2009/08/31/insight3d-and-qt/</link>
		<comments>http://blogs.agi.com/insight3d/index.php/2009/08/31/insight3d-and-qt/#comments</comments>
		<pubDate>Mon, 31 Aug 2009 15:54:11 +0000</pubDate>
		<dc:creator>mbartholomew</dc:creator>
				<category><![CDATA[Developer]]></category>

		<guid isPermaLink="false">http://blogs.agi.com/insight3d/?p=523</guid>
		<description><![CDATA[Qt is a commonly used cross-platform application development framework.  If you are building a Qt application for Windows, you can easily embed Insight3D in your application using the Qt Windows Forms Interop Framework.

Once you have added the Qt Windows Forms Interop framework to your Qt project, adding Insight3D is easy.  First, open your [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://qt.nokia.com/">Qt</a> is a commonly used cross-platform application development framework.  If you are building a Qt application for Windows, you can easily embed Insight3D in your application using the <a href="http://qt.nokia.com/products/appdev/add-on-products/catalog/4/Windows/qtwinforms">Qt Windows Forms Interop Framework</a>.<br />
<span id="more-523"></span><br />
Once you have added the Qt Windows Forms Interop framework to your Qt project, adding Insight3D is easy.  First, open your Qt project’s properties, and ensure that <strong>Common Language Runtime support</strong> is enabled:</p>
<p><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2009/08/clip_image0021.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image002" src="http://blogs.agi.com/insight3d/wp-content/uploads/2009/08/clip_image002_thumb1.jpg" border="0" alt="clip_image002" width="494" height="341" /></a></p>
<p>Next, navigate to the <strong>Framework and References</strong> property panel, and add the <em>AGI.Foundation.Graphics</em> assembly to the <strong>References</strong> section of the panel.  The AGI.Foundation.Graphics.dll can be found in the Assemblies directory of the AGI Components install location. You can also add references to other AGI Components assemblies if you want to use them within your application:</p>
<p><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2009/08/clip_image0041.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image004" src="http://blogs.agi.com/insight3d/wp-content/uploads/2009/08/clip_image004_thumb1.jpg" border="0" alt="clip_image004" width="497" height="345" /></a></p>
<p>Before you can use the Windows Forms Interop framework for Qt, you need to initialize it. You can do this by adding the line highlighted below to the entry point for your application:</p>
<pre class="brush: cpp; highlight: [6];">
#include &amp;lt;qtwinforms.h&amp;gt;
...
int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    QtWinFormsUtils::initWindowsFormsForQt();
    ...
}
</pre>
<p>In the QWidget that will host the Insight3D control, add members for the Insight3D control and a QtControlHost widget:</p>
<pre class="brush: cpp; highlight: [11,12];">
#include &amp;lt;QWidget&amp;gt;
#include &amp;lt;qtwinformscontrolhost.h&amp;gt;

class Insight3DWidget : public QWidget
{
    Q_OBJECT
public:
    Insight3DWidget();

private:
    gcroot&amp;lt;AGI::Foundation::Graphics::Insight3D ^&amp;gt; Insight3D;
    QtControlHost *Insight3DHost;
};
</pre>
<p>Then, when you are ready to instantiate the Insight3D control, you can activate your AGI Components license, create a new Insight3D control, and construct a QtControlHost widget with the Insight3D control and the parent widget:</p>
<pre class="brush: cpp; highlight: [6,7,8];">
#include &amp;quot;mainwindow.h&amp;quot;
#include &amp;lt;QVBoxLayout&amp;gt;

Insight3DWidget::Insight3DWidget()
{
    AGI::Foundation::Licensing::ActivateLicense(&amp;quot;Cut and paste the contents of your .lic file here&amp;quot;);
    Insight3D = gcnew AGI::Foundation::Graphics::Insight3D();
    Insight3DHost = new QtControlHost(Insight3D, this);

    QVBoxLayout *vl = new QVBoxLayout();
    vl-&amp;gt;addWidget(Insight3DHost);
    setLayout(vl);
}
</pre>
<p><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2009/08/clip_image0061.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image006" src="http://blogs.agi.com/insight3d/wp-content/uploads/2009/08/clip_image006_thumb1.jpg" border="0" alt="clip_image006" width="495" height="444" /></a></p>
<p>At this point, when you construct your widget, you are able to fully use and interact with the Insight3D control in your Qt application.  You can continue to build your application utilizing AGI Components as you would with any C++/CLI application.</p>
 <img src="http://blogs.agi.com/insight3d/wp-content/plugins/feed-statistics.php?view=1&post_id=523" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blogs.agi.com/insight3d/index.php/2009/08/31/insight3d-and-qt/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Getting Started with Insight3D on the Web</title>
		<link>http://blogs.agi.com/insight3d/index.php/2009/08/20/getting-started-with-insight3d-on-the-web/</link>
		<comments>http://blogs.agi.com/insight3d/index.php/2009/08/20/getting-started-with-insight3d-on-the-web/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 21:42:14 +0000</pubDate>
		<dc:creator>mbartholomew</dc:creator>
				<category><![CDATA[Developer]]></category>

		<guid isPermaLink="false">http://blogs.agi.com/insight3d/?p=474</guid>
		<description><![CDATA[At the 2009 AGI User's Conference, we demonstrated new technology that allows Insight3D applications to be deployed over the web.  While we are rolling out the new technology, you can still get started building a web application with a version of Insight3D that is available today.  Because Insight3D is a .NET library, it is easy [...]]]></description>
			<content:encoded><![CDATA[<p>At the <a href="http://www.uc.agi.com/">2009 AGI User's Conference</a>, we demonstrated new technology that allows Insight3D applications to be deployed over the web.  While we are rolling out the new technology, you can still get started building a web application with a <a href="http://www.insight3d.com/">version of Insight3D</a> that is available today.  Because Insight3D is a .NET library, it is easy to develop and deploy your applications over the web so that they can be run in virtually any web browser on the Windows platform, and even in browser-enabled applications, like Google Earth. In the first part of this blog series, I’ll take you through the basics of getting started developing an Insight3D web application for deployment on your intranet.</p>
<p><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2009/08/clip_image002.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image002" src="http://blogs.agi.com/insight3d/wp-content/uploads/2009/08/clip_image002_thumb.jpg" border="0" alt="clip_image002" width="503" height="430" /></a></p>
<p><span id="more-474"></span></p>
<p>While there are various technologies that allow for Insight3D to be run in a web browser, we are going to focus on a particular one in this entry: <a href="http://msdn.microsoft.com/en-us/library/aa970060.aspx">XAML Browser Applications</a> (or XBAPs.) There are many advantages to XBAPs over other web technologies.</p>
<p>For instance, deployment is simplified through <a href="http://msdn.microsoft.com/en-us/library/t71a733d%28VS.80%29.aspx">Microsoft ClickOnce</a>, allowing any prerequisites for a web application to be pushed out over your intranet or installed with a simple client side installer.  Insight3D, in the form of a client side plug-in installer, is only 12 megabytes.  The experience is also clean for your end users – there is no information bar or security warnings when the web application is run; clients can click on an html link and be interacting with a full Insight3D application in their web browser in seconds.  Also, once the plug-in is installed, XBAPs allows you to update your application logic and push out the updates to your hosting server. When clients connect to your Insight3D web application, the update is automatically deployed without any further install, and the transition to newer versions of your application is completely transparent to your clients.</p>
<p>To get started, let’s create a new XBAP project. Create a new project in Microsoft Visual Studio and select the WPF Browser Application template under the language of your choice.  WPF Browser Application projects are available starting with the .NET 3.0 framework.  In this walk-through, we’ll build our web application using C#, as seen below.</p>
<p><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2009/08/clip_image004.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image004" src="http://blogs.agi.com/insight3d/wp-content/uploads/2009/08/clip_image004_thumb.jpg" border="0" alt="clip_image004" width="502" height="367" /></a></p>
<p>In your project references, add references to the AGI.Foundation.Graphics and AGI.Foundation.Core assemblies, which can be found in the Assemblies directory of your AGI Components install location. In addition, since we will be hosting the Windows Forms based Insight3D control in our web application, add references to the .NET assemblies WindowsFormsIntegration and System.Windows.Forms.</p>
<p><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2009/08/clip_image006.jpg"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="clip_image006" src="http://blogs.agi.com/insight3d/wp-content/uploads/2009/08/clip_image006_thumb.jpg" border="0" alt="clip_image006" width="301" height="332" /></a></p>
<p>We will also configure the ClickOnce Security Settings for our XBAP project. Since this walkthrough is for intranet deployment, in the project properties, navigate to the Security category and select the “This is a full trust application” option, as seen below:</p>
<p><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2009/08/clip_image008.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image008" src="http://blogs.agi.com/insight3d/wp-content/uploads/2009/08/clip_image008_thumb.jpg" border="0" alt="clip_image008" width="512" height="457" /></a></p>
<p>Next, let's add the Insight3D control. Open the XAML text editor for Page1.xaml, and add the two lines shown below. As you type the code for the second line, an event handler should be added to your application to notify us when the page hosting our application has loaded:</p>
<pre class="brush: xhtml;">
xmlns:my=&quot;clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration&quot;
Loaded=&quot;Page_Loaded&quot;
</pre>
<p>Also, let's add a DockPanel container to hold the WindowsFormsHost that will host our Insight3D control:</p>
<pre class="brush: xhtml;">
&lt;DockPanel&gt;
    &lt;my:WindowsFormsHost DockPanel.Dock=&quot;Top&quot; Name=&quot;Insight3DHost&quot;/&gt;
&lt;/DockPanel&gt;
</pre>
<p>Your final Page1.xaml code will look similar to:</p>
<pre class="brush: xhtml;">
&lt;Page x:Class=&quot;Insight3DWebApplication.Page1&quot;
    xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;
    xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;
    xmlns:my=&quot;clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration&quot;
    Loaded=&quot;Page_Loaded&quot;
    Title=&quot;Page1&quot;&gt;
    &lt;DockPanel&gt;
        &lt;my:WindowsFormsHost DockPanel.Dock=&quot;Top&quot; Name=&quot;Insight3DHost&quot;/&gt;
    &lt;/DockPanel&gt;
&lt;/Page&gt;
</pre>
<p>Next, open Page1.xaml.cs and add a member for the Insight3D control to the Page1 class as follows:</p>
<pre class="brush: csharp;">
AGI.Foundation.Graphics.Insight3D Insight3D = null;
</pre>
<p>We will instantiate the Insight3D control when the page loads, so add the following two lines to the Page_Loaded event handler:</p>
<pre class="brush: csharp;">
Insight3D = new AGI.Foundation.Graphics.Insight3D();
Insight3DHost.Child = Insight3D;
</pre>
<p>Finally, since we will eventually be deploying our application over the web, we need to activate the appropriate license. We can add a static constructor to our Page1 class, and then call the ActivateLicense method with a string containing the contents of our .lic file:</p>
<pre class="brush: csharp;">
public partial class Page1 : Page
{
    AGI.Foundation.Graphics.Insight3D Insight3D = null;

    static Page1()
    {
        AGI.Foundation.Licensing.ActivateLicense(
            @&quot;Copy and paste the contents of your .lic file here&quot;);
    }
    public Page1()
    {
        InitializeComponent();
    }

    private void Page_Loaded(object sender, RoutedEventArgs e)
    {
        Insight3D = new AGI.Foundation.Graphics.Insight3D();
        Insight3DHost.Child = Insight3D;
    }
}
</pre>
<p>At this point, when you run your project, you should see the Insight3D globe running in a web browser. You can continue to develop your web application as you would a normal Insight3D application.</p>
<p>In future parts of this series, I will discuss deployment and security, upcoming improvements to our web technology, and how to make your Insight3D web application run in virtually any browser on Windows.</p>
 <img src="http://blogs.agi.com/insight3d/wp-content/plugins/feed-statistics.php?view=1&post_id=474" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blogs.agi.com/insight3d/index.php/2009/08/20/getting-started-with-insight3d-on-the-web/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>SIGGRAPH 2009 Trip Report</title>
		<link>http://blogs.agi.com/insight3d/index.php/2009/08/10/siggraph-2009-trip-report/</link>
		<comments>http://blogs.agi.com/insight3d/index.php/2009/08/10/siggraph-2009-trip-report/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 18:52:39 +0000</pubDate>
		<dc:creator>Cozzi</dc:creator>
				<category><![CDATA[Graphics Developer]]></category>

		<guid isPermaLink="false">http://blogs.agi.com/insight3d/?p=446</guid>
		<description><![CDATA[Once again, SIGGRAPH was jam packed with the latest in computer graphics.  For the areas we're interested in, this year seemed a little more incremental than last year, probably because last year had big announcements, including Larrabee and OpenGL 3.  Nonetheless, we were exposed to plenty of ideas that will help us keep the technology [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2009/08/Siggraph2009.jpg"><img class="size-full wp-image-447 alignright" title="Siggraph2009" src="http://blogs.agi.com/insight3d/wp-content/uploads/2009/08/Siggraph2009.jpg" alt="Siggraph2009" width="100" height="306" /></a>Once again, <a href="http://www.siggraph.org/s2009/">SIGGRAPH</a> was jam packed with the latest in computer graphics.  For the areas we're interested in, this year seemed a little more incremental than <a href="http://blogs.agi.com/insight3d/index.php/2008/08/18/siggraph-2008-trip-report/">last year</a>, probably because last year had big announcements, including <a href="http://softwarecommunity.intel.com/UserFiles/en-us/File/larrabee_manycore.pdf">Larrabee</a> and <a href="http://www.khronos.org/news/press/releases/khronos_releases_opengl_30_specifications_to_support_latest_generations_of/">OpenGL 3</a>.  Nonetheless, we were exposed to plenty of ideas that will help us keep the technology underlying Insight3D on the cutting edge.  I'll hit the highlights in this post.</p>
<p>We tend to spend most of our time in SIGGRAPH courses.  This year, my favorite one was <a href="http://www.siggraph.org/s2009/sessions/courses/details/?type=course&amp;id=12">Advances in Real-Time Rendering</a>.   <a href="http://diaryofagraphicsprogrammer.blogspot.com/">Wolfgang Engel</a> gave a good talk on deferred shading and light pre-pass.  Deferred shading showed up just about everywhere at SIGGRAPH this year, and rightfully so, since it is such a cool technique.  Currently, Insight3D uses so-called forward shading to allow support for a wide array of video cards.</p>
<p><span id="more-446"></span></p>
<p>Out of all the talks in the real-time rendering course, I enjoyed Alex Evan's talk on LittleBIGPlanet the most.  Overall, Little Big Planet is a very impressive engine for "1.5 graphics programmers over 3 years."  Although they tried to avoid it, they wound up using deferred shading and a MSAA hack to get 2 layer translucency (translucency is difficult in deferred shading since only a single z value is available during shading).  I also liked: "give artists too many knobs and they will ignore them."  I think the same is true of developers; if your API is overwhelming, developers will avoid it.  We've tried to balance flexibility and simplicity with our interfaces for Insight3D.</p>
<p><a href="http://www.siggraph.org/s2009/sessions/courses/details/?type=course&amp;id=2">An Introduction to Shader-Based OpenGL Programming</a> was a more polished version of <a href="http://www.opengl-redbook.com/SIGGRAPH/08/">last year's OpenGL course</a>.</p>
<p>As usual, there was your fair share of interactive ray tracing.  This year, there was a trend toward real-time ray tracing APIs, such as NVIDIA's <a href="http://www.nvidia.com/object/optix.html">OptiX</a> and Caustic Graphics' <a href="http://www.caustic.com/caustic-rt_caustic-gl.php">CausticGL</a>.  As I've briefly <a href="http://blogs.agi.com/insight3d/index.php/2008/01/18/introducing-primitives/">mentioned before</a>, we've architected Insight3D so all the OpenGL calls are isolated behind a renderer interface.  Although we don't have any immediate plans to do so, it's very likely that we could implement our renderer using a ray tracing API.</p>
<p>The <a href="http://www.khronos.org/news/events/detail/siggraph_2009_new_orleans/">OpenGL BOF</a> was crowded as always.  This included information on <a href="http://www.khronos.org/opengl/">OpenGL 3.2 and GLSL 1.5</a>.  I'm happy to see that geometry shaders are core in 3.2.  I hope we get improved hardware support for them since they have several uses in Insight3D, including the <a href="http://www.agi.com/resources/help/online/AGIComponents/source/html/T_AGI_Foundation_Graphics_SurfaceMeshPrimitive.htm">SurfaceMeshPrimitive</a> and <a href="http://www.agi.com/resources/help/online/AGIComponents/index.html?page=source%2Fhtml%2FT_AGI_Foundation_Graphics_MarkerBatchPrimitive.htm">MarkerBatchPrimitive</a>.  Both of these primitives will fallback to vertex shaders to support older hardware.  I like the <a href="http://www.khronos.org/files/opengl-quick-reference-card.pdf">API Quick Reference Card</a> that was handed out at the BOF.  References like this are handy, especially when you are searching for GLSL functions.  The OpenGL BOF was the first time I heard anything about <a href="http://www.khronos.org/news/press/releases/khronos-webgl-initiative-hardware-accelerated-3d-graphics-internet/">WebGL</a>.  I think bringing 3D to the web is great.  WebGL is an interesting approach, but I feel that OpenGL is pretty low level for JavaScript.  As they said at the BOF, development of higher level libraries is going to be key.  Insight3D is becoming web-enabled (although not using WebGL), keep your eyes open for more information.</p>
<p>Last year, I really enjoyed <a href="http://s08.idav.ucdavis.edu/">Beyond Programmable Shading</a>.  I was pleasantly surprised to see that the course contained almost all <a href="http://s09.idav.ucdavis.edu/">new content</a> this year.  Kayvon Fatahalian's <a href="http://s09.idav.ucdavis.edu/talks/02_kayvonf_gpuArchTalk09.pdf">overview of GPU architecture</a> was even better than it was last year.  He provided insight into things like why branches and shader length affect performance.  Deferred shading showed up again when Johan Andersson showed a DX11 Compute Shader implementation in his <a href="http://s09.idav.ucdavis.edu/talks/04-JAndersson-ParallelFrostbite-Siggraph09.pdf">presentation</a>.  Also of interest to the Insight3D team was J.M.P. van Waveren's <a href="http://s09.idav.ucdavis.edu/talks/05-JP_id_Tech_5_Challenges.pdf">presentation</a> on id Tech 5 where he provided some details on virtual texturing.  Techniques to handle massive amounts of textures are also useful to Insight3D's support for high resolution imagery.  Parallelism was a common theme throughout all the engine talks in this course.  Insight3D has some parallelism built in; for example, terrain and imagery disk reads occur in separate threads.  There are other areas we can add parallelism to in the future; for example, culling and rendering can be done in a producer-consumer style.</p>
<p>One of my favorite parts of SIGGRAPH is browsing all the new computer graphics books.  I am excited about <a href="http://www.akpeters.com/product.asp?ProdCode=3349">Graphics Shaders:  Theory and Practice</a> and <a href="http://www.akpeters.com/product.asp?ProdCode=4131">Game Engine Architecture</a>, both from A K Peters.  Although not new this year, I really like <a href="http://www.elsevier.com/wps/find/bookdescription.cws_home/713262/description#description">Mobile 3D Graphics with OpenGL ES and M3G</a> from <span>Morgan Kaufmann.  The chapters on scene management and performance describe many of the techniques we use in Insight3D.  Even though the book is targeted at moblie devices, much of the content is applicable to PCs.<br />
</span></p>
 <img src="http://blogs.agi.com/insight3d/wp-content/plugins/feed-statistics.php?view=1&post_id=446" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blogs.agi.com/insight3d/index.php/2009/08/10/siggraph-2009-trip-report/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Favorite Features: Display Conditions</title>
		<link>http://blogs.agi.com/insight3d/index.php/2009/07/23/favorite-features-display-conditions/</link>
		<comments>http://blogs.agi.com/insight3d/index.php/2009/07/23/favorite-features-display-conditions/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 15:25:23 +0000</pubDate>
		<dc:creator>arybak</dc:creator>
				<category><![CDATA[Developer]]></category>
		<category><![CDATA[Favorite Features]]></category>

		<guid isPermaLink="false">http://blogs.agi.com/insight3d/?p=285</guid>
		<description><![CDATA[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 [...]]]></description>
			<content:encoded><![CDATA[<p>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 <a href="http://www.drexel.edu/">Drexel University</a>, where I am studying for both a B.S. and an M.S. degree in <a href="https://www.cs.drexel.edu/">Computer Science</a>.</p>
<h3>Introduction</h3>
<p>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.</p>
<p>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 <a href="http://www.agi.com/resources/help/online/AGIComponents/index.html?page=source%2Fhtml%2FT_AGI_Foundation_Graphics_AltitudeDisplayCondition.htm">AltitudeDisplayCondition</a> (which becomes active when the camera's altitude above the surface is within a specified interval) to a <a href="http://www.agi.com/resources/help/online/AGIComponents/index.html?page=source%2Fhtml%2FT_AGI_Foundation_Graphics_PolylinePrimitive.htm">PolyLinePrimitive</a>.   Here is the code:</p>
<pre class="brush: csharp;">
CentralBody earth = CentralBodiesFacet.GetFromContext().GetByName(&quot;Earth&quot;);
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.Set(shape.Positions);
line.Color = Color.White;

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

SceneManager.Primitives.Add(line);
</pre>
<p>As you can see in the images below, the circle is visible only when the camera is below this altitude.</p>
<p style="text-align: center;"><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2009/07/cityfar.jpg"><img class="aligncenter size-full wp-image-438" style="margin-left: 2px; margin-right: 2px;" title="cityclose" src="http://blogs.agi.com/insight3d/wp-content/uploads/2009/07/cityclose.jpg" alt="cityclose" width="245" height="185" /><img class="aligncenter size-full wp-image-439" style="margin-left: 2px; margin-right: 2px;" title="cityfar" src="http://blogs.agi.com/insight3d/wp-content/uploads/2009/07/cityfar.jpg" alt="cityfar" width="245" height="185" /><br />
</a></p>
<p><span id="more-285"></span><br />
<h3>Layering</h3>
<p>Sometimes the user might want to see an object at a higher level of detail when it is close and at a lower level of detail when it is far away.  In this case, we can use display conditions to create layers at which different levels of detail are shown.  If we create an <a href="http://www.agi.com/resources/help/online/AGIComponents/index.html?page=source%2Fhtml%2FT_AGI_Foundation_Graphics_AltitudeDisplayCondition.htm">AltitudeDisplayCondition</a> for each layer, we can limit at which altitudes each layer shows up.  This way, at low altitudes, we can show the more detailed layers and at high altitudes, we can show the less detailed layers.  The images below show an example of this:</p>
<p style="text-align: center;"><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2009/07/close.jpg"><img class="size-full wp-image-416 aligncenter" title="close" src="http://blogs.agi.com/insight3d/wp-content/uploads/2009/07/close.jpg" alt="close" width="500" height="375" /></a></p>
<p><img src="file:///C:/Documents%20and%20Settings/arybak/Desktop/close.jpg" alt="" /></p>
<p style="text-align: center;">
<p>Zoomed in close, each object is a 3D model.</p>
<p style="text-align: center;"><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2009/07/medium.jpg"><img class="aligncenter size-full wp-image-419" title="medium" src="http://blogs.agi.com/insight3d/wp-content/uploads/2009/07/medium.jpg" alt="medium" width="500" height="375" /></a></p>
<p style="text-align: center;">
<p>At a medium zoom, the models become markers.</p>
<p style="text-align: center;"><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2009/07/far.jpg"><img class="aligncenter size-full wp-image-417" title="far" src="http://blogs.agi.com/insight3d/wp-content/uploads/2009/07/far.jpg" alt="far" width="500" height="375" /></a></p>
<p style="text-align: center;">
<p>When zoomed far away, the markers become points.</p>
<p>Note that this level of detail scheme has two distinct benefits.  First of all, there is a significant performance gain.  When the models get replaced with simple markers or points, they are rendered much faster.  Second, there is a visual benefit.  When zoomed out far, the models become very small and hard to see or click on.  Since we are replacing them with markers or points of a constant pixel size, it makes them much easier to see and interact with.</p>
<h3>Aggregation/De-aggregation</h3>
<p>Often, when looking at large collections of objects, the user might like to see a hierarchical way of presenting such a collection so that when viewing from far away, there is less information to analyze.  For example, let's say we have two armies somewhere in Iraq, and we want to display the information about each specific soldier.  This is useful when the user is zoomed in very close, but as the user zooms out, we might want to aggregate soldiers into squads, squads into platoons, platoons into companies, and so on.  This can be implemented quite easily using display conditions.  In fact, I did this during my first week here!  We would simply have to create a set of <a href="http://www.agi.com/resources/help/online/AGIComponents/index.html?page=source%2Fhtml%2FT_AGI_Foundation_Graphics_DistanceDisplayCondition.htm">DistanceDisplayCondition</a>s, which become active for objects within a specified distance from the camera.  Each display condition would apply to an organizational element.  These would be layered so that when one ends, the next one starts.  The image below shows what this might look like:</p>
<p style="text-align: center;"><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2009/07/aggregation.jpg"><img class="aligncenter size-full wp-image-415" title="aggregation" src="http://blogs.agi.com/insight3d/wp-content/uploads/2009/07/aggregation.jpg" alt="aggregation" width="500" height="375" /></a></p>
<p>As you can see, the markers closest to the camera are individual soldiers (represented by 2525B symbology).  The markers that are further away are squads.  As we get even further away, squads are aggregated into platoons.  This way, the user can see the most detail about the elements that are nearby and less detailed representations of elements that are far away.</p>
<h3>Object Descriptions</h3>
<p>Another cool use of display conditions is to pop up a screen overlay with a description of an object when the camera gets close enough to that object.  In this case, we use the <a href="http://www.agi.com/resources/help/online/AGIComponents/index.html?page=source%2Fhtml%2FT_AGI_Foundation_Graphics_DistanceToPositionDisplayCondition.htm">DistanceToPositionDisplayCondition</a>, which becomes active when the camera's distance away from a specified position (in this case, the primitive's position) is within a defined interval.  Here is an example:</p>
<p style="text-align: center;"><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2009/07/tankclose.jpg"><img class="aligncenter size-full wp-image-412" title="tankclose" src="http://blogs.agi.com/insight3d/wp-content/uploads/2009/07/tankclose.jpg" alt="tankclose" width="500" height="375" /></a></p>
<p>When zoomed in close to this model, a descriptive screen overlay appears.</p>
<p style="text-align: center;"><a href="http://blogs.agi.com/insight3d/wp-content/uploads/2009/07/tankfar.jpg"><img class="aligncenter size-full wp-image-413" title="tankfar" src="http://blogs.agi.com/insight3d/wp-content/uploads/2009/07/tankfar.jpg" alt="tankfar" width="500" height="375" /></a></p>
<p>As we zoom further away, this overlay disappears.</p>
<p>Keep in mind that this is a simple example.  The screen overlay could also be used as an object-specific user interface, such as a toolbar that acts on the object.</p>
<h3>Conclusion</h3>
<p>As you can see, display conditions are a powerful and extremely useful tool for developing 3D applications.  I've only mentioned a few example uses here, but you can check out the <a href="http://www.agi.com/resources/help/online/AGIComponents/index.html?page=source%2FProgrammer%27s%20Guide%2FOverview%2FGraphics%2FPrimitives%2FDisplayCondition.html">Display Conditions</a> documentation for more information.</p>
 <img src="http://blogs.agi.com/insight3d/wp-content/plugins/feed-statistics.php?view=1&post_id=285" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blogs.agi.com/insight3d/index.php/2009/07/23/favorite-features-display-conditions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Matlab with Insight3D</title>
		<link>http://blogs.agi.com/insight3d/index.php/2009/07/07/matlab-with-insight3d/</link>
		<comments>http://blogs.agi.com/insight3d/index.php/2009/07/07/matlab-with-insight3d/#comments</comments>
		<pubDate>Tue, 07 Jul 2009 18:26:18 +0000</pubDate>
		<dc:creator>deron</dc:creator>
				<category><![CDATA[Developer]]></category>
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blogs.agi.com/insight3d/?p=281</guid>
		<description><![CDATA[Over at the Dynamic Geometry Library Blog, Ted Driver explains how to use Insight3D and other AGI Components in Matlab.
 ]]></description>
			<content:encoded><![CDATA[<p>Over at the <a href="http://blogs.agi.com/dynamicGeometry/">Dynamic Geometry Library Blog</a>, Ted Driver explains how to <a href="http://blogs.agi.com/dynamicGeometry/?p=94">use Insight3D and other AGI Components in Matlab</a>.</p>
 <img src="http://blogs.agi.com/insight3d/wp-content/plugins/feed-statistics.php?view=1&post_id=281" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blogs.agi.com/insight3d/index.php/2009/07/07/matlab-with-insight3d/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
