Raster and Projection Streams

The RasterStream and ProjectionStream classes allow for implementers to stream new data to a Raster and Projection over time. Since they implement Raster and Projection respectively, they can be passed to any class that accepts those base types; however, in contrast to the base types, their data can change over time.

For example, this pattern allows for a projection to move and change orientation with time, or a raster within STK Engine to stream video. Since textures can be created from rasters, users can place video and other dynamic raster data on any object within STK Engine that supports textures, such as the marker batch and surface mesh primitives. Similarly, the ProjectedRasterOverlay globe overlay, which projects an image onto the ellipsoid or terrain, can be used with RasterStream and ProjectionStream to display video while transforming how it is projected.

Subsequent time steps of a surface mesh primitive using a texture created from a RasterStream.

Both the RasterStream and ProjectionStream classes within STK Engine contain an Update method for updating the objects at a specific time. Below, RasterStream.Update is implemented to provide raster data from the successive frames of an animated GIF by copying each frame into the Raster from a .NET Bitmap.

Note: When implementing a derived class of RasterStream, the Attributes property of the Raster should be set in the constructor of the derived class.

Subsequent animation steps of a ProjectedRasterOverlay globe overlay using a RasterStream and ProjectionStream.

The relationship between the Orientation of a ProjectionStream and a raster is shown below. In the left image, the orientation axes are shown on a raster, a frame from the video. The x axis is along the horizontal from left to right. The y axis is along the vertical from bottom to top. The -z axis is into the raster. In the right image, the orientation axes are drawn over a projection of that raster onto terrain.

A frame from a video with the x and y orientation axes shown. The -z axis is into the frame.

The same frame projected onto terrain with the orientation axes shown.

Updating of raster and projection streams is tied to the current time and uses the UpdateDelta property of RasterStream and ProjectionStream to allow a user to control the update rate of the data. The UpdateDelta property is a Duration, so an update delta of .1 seconds will update 10 times per second while animating. If the update delta is set to 0, the stream's Update method is called every time the time changes.

Note: VideoStream, which implements RasterStream, can be used within STK Engine for easy reading of video and functionality to synchronize the video with the time.

Since RasterStream and ProjectionStream implement Raster and Projection respectively, they can be passed to any class that accepts those base types.

Subsequent time steps of a marker batch primitive using a texture from a RasterStream.

You can configure various visual attributes of the ProjectedRasterOverlay. You can change the color and translucency of the ProjectedRasterOverlay, and also individually control the color and translucency of shadows, the frustum, far plane, and footprint border.

Note: To enable rendering of shadows, or the projection's frustum, or far plane, set the ShowShadows, ShowFrustum, or ShowFarPlane properties to true. To enable a border around the projection's foot print, set the BorderWidth property.

The far plane of the projection when ProjectedRasterOverlay ShowFarPlane is enabled.

ProjectedRasterOverlay also supports projection on to Models. The following code snippet enables model projection for a central body:

[C#] Copy Code
scene.GlobeOverlaySettings.ProjectedRasterModelProjection = true;

Projection on to a Model primitive using a texture created from a VideoStream. ProjectedRasterOverlay ShowFarPlane is also enabled.

See the GraphicsHowTo for the complete set of RasterStream and ProjectionStream examples shown in this overview. Learn more about the Graphics Plugin classes used for Raster and Projection streams in the STK Engine Plugins area.

STK Engine for UNIX 11.2