Welcome to MSDN Blogs Sign in | Join | Help

BillboardActor.cs

using System;

using System.Collections.Generic;

using System.Drawing;

using System.Text;

 

using Microsoft.MapPoint.Rendering3D;

using Microsoft.MapPoint.Rendering3D.GraphicsProxy;

using Microsoft.MapPoint.Rendering3D.Steps.Actors;

using Microsoft.MapPoint.Geometry.VectorMath;

 

namespace VirtualEarth3DSamplePlugins.Billboard

{

    class BillboardActor : Microsoft.MapPoint.Rendering3D.Steps.Actors.Actor

    {

        private SpriteGraphicsObject billboard;

        private Texture texture;

 

        #region Constructor

        public BillboardActor(LatLonAlt position)

        {

            this.texture = Texture.FromResource(this.GetType().Assembly, "VirtualEarth3DSamplePlugins.Billboard.Flower.png");

 

            this.billboard = new SpriteGraphicsObject();

            this.billboard.Texture = this.texture;

            this.billboard.Mode = SpriteMode.Billboard;

            this.billboard.Scale = new Vector2D(1000, 1000);

            this.billboard.Color = Color.White;

            this.billboard.AlphaEnable = true;

            this.billboard.Position = position.GetVector();

        }

        #endregion

        #region Overrides

        public override void Render(Microsoft.MapPoint.Rendering3D.Scene.SceneState sceneState)

        {

            RenderQueues renderQueues = sceneState.GetData<RenderQueues>();

 

            renderQueues.AddAlphaRenderable(0, this.billboard);

        }

        #endregion

    }

}

Published Wednesday, November 14, 2007 11:20 AM by Kristoffer

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

No Comments

Leave a Comment

(required) 
required 
(required) 
 
Page view tracker