New in AGI Components 2009 r7: Primitives in any Reference Frame



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 the primitive's ReferenceFrame 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.

Facility

Make sure to check out the "Primitives -> Model -> 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.

The other HowTo example to check out is "Camera -> Follow an Earth orbiting satellite."  The model's reference frame is now based on the Sgp4Propagator used to propagate the satellite.  This means the model's position is no longer manually set when the animation time changes.

Satellite

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.

Best Practices

To close this entry, here are a few best practices for using reference frames with primitives.

  • Avoid manually converting lots of data between reference frames for use with primitives.  For example, if you have 10,000 points to visualize with PointBatchPrimitive, 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.
  • 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 Position and Orientation 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.
  • Use ReferenceFrameGraphics to visualize your reference frames, especially during debugging or to help orientate a model.

0 Responses to “New in AGI Components 2009 r7: Primitives in any Reference Frame”


  1. No Comments

Leave a Reply