public static void DrawArtwork(RenderContext renderContext)
        {
            if (Artwork == null)
            {
                if (artFile == null)
                {
                    artFile = new Folder();
                    artFile.LoadFromUrl("http://www.worldwidetelescope.org/wwtweb/catalog.aspx?W=hevelius", OnArtReady);
                    //artFile.LoadFromUrl("http://www.worldwidetelescope.org/wwtweb/catalog.aspx?W=and", OnArtReady);
                }

                return;
            }
            maxSeperation = Math.Max(.50, Math.Cos((renderContext.FovAngle * 2) / 180.0 * Math.PI));


            foreach (Place place in Artwork)
            {
                //BlendState bs = PictureBlendStates[imageset.Name];
                //bs.TargetState = Settings.Active.ConstellationArtFilter.IsSet(imageset.Name);

                //if (bs.State)
                bool  reverse  = false;
                Place centroid = ConstellationCentroids[place.Constellation];
                if (centroid != null)
                {
                    Vector3d pos = Coordinates.RADecTo3d(reverse ? -centroid.RA - 6 : centroid.RA, reverse ? centroid.Dec : centroid.Dec);

                    if (Vector3d.Dot(renderContext.ViewPoint, pos) > maxSeperation)
                    {
                        renderContext.DrawImageSet(place.StudyImageset, 100);
                    }
                }
            }
        }
Esempio n. 2
0
 public override bool Draw(RenderContext renderContext, float opacity, bool flat)
 {
     if (!loaded)
     {
         return(false);
     }
     //if (!flat)
     //{
     //    renderContext.setRasterizerState(TriangleCullMode.CullClockwise);
     //}
     renderContext.WorldBase = renderContext.World;
     renderContext.ViewBase  = renderContext.View;
     renderContext.MakeFrustum();
     renderContext.DrawImageSet(imageSet, this.Opacity * opacity * 100);
     return(true);
 }
Esempio n. 3
0
        public void Render()
        {
            RenderTriangle.Width  = RenderContext.Width = Canvas.Width;
            RenderTriangle.Height = RenderContext.Height = Canvas.Height;
            Tile.TilesInView      = 0;
            Tile.TilesTouched     = 0;
            RenderContext.Device.Save();
            RenderContext.Device.FillStyle = "black";
            RenderContext.Device.FillRect(0, 0, RenderContext.Width, RenderContext.Height);
            //RenderContext.Device.ClearRect(0, 0, RenderContext.Width, RenderContext.Height);
            RenderContext.Device.Restore();
            RenderContext.SetupMatricesSpace3d(RenderContext.Width, RenderContext.Height);
            RenderContext.DrawImageSet(RenderContext.BackgroundImageSet, 1);

            int tilesInView  = Tile.TilesInView;
            int itlesTouched = Tile.TilesTouched;
        }
Esempio n. 4
0
        //        static BitmapImage PlanetShadow;
        static void DrawSphere(RenderContext renderContext, int planetID)
        {
            string planetName = GetNameFrom3dId(planetID);
            Imageset planet = WWTControl.Singleton.GetImagesetByName(planetName);

            if (planet == null)
            {
                planet = WWTControl.Singleton.GetImagesetByName("Bing Maps Aerial");
            }

            if (planet != null)
            {
                renderContext.DrawImageSet(planet, 100);
                if (planetID == (int)SolarSystemObjects.Earth)
                {
                    // todo clouds   Earth3d.MainWindow.DrawCloudsNoCheck();
                }
                return;

            }
        }
Esempio n. 5
0
        public static void DrawArtwork(RenderContext renderContext)
        {
            if (Artwork == null)
            {
                if (artFile == null)
                {
                    artFile = new Folder();
                    artFile.LoadFromUrl("http://www.worldwidetelescope.org/wwtweb/catalog.aspx?W=hevelius", OnArtReady);
                    //artFile.LoadFromUrl("http://www.worldwidetelescope.org/wwtweb/catalog.aspx?W=and", OnArtReady);
                }

                return;
            }
            maxSeperation = Math.Max(.50, Math.Cos((renderContext.FovAngle * 2) / 180.0 * Math.PI));

            foreach (Place place in Artwork)
            {
                //BlendState bs = PictureBlendStates[imageset.Name];
                //bs.TargetState = Settings.Active.ConstellationArtFilter.IsSet(imageset.Name);

                //if (bs.State)
                bool reverse = false;
                Place centroid = ConstellationCentroids[place.Constellation];
                if (centroid != null)
                {
                    Vector3d pos = Coordinates.RADecTo3d(reverse ? -centroid.RA - 6 : centroid.RA, reverse ? centroid.Dec : centroid.Dec);

                    if (Vector3d.Dot(renderContext.ViewPoint, pos) > maxSeperation)
                    {

                        renderContext.DrawImageSet(place.StudyImageset, 100);
                    }

                }
            }
        }