예제 #1
0
        public List<Star> BuildStarList(List<StarSystem> collection)
        {
            List<Star> tempList = new List<Star>();

            foreach (var starSystem in collection.OrderBy(order => order.Z))
            {
                Star star = new Star();

                star.starID = starSystem.id;
                star.name = starSystem.name;

                star.centerX = 285;
                star.centerY = 285;

                star.zoom = 64;

                star.originPoint = new Point3D(starSystem.X, starSystem.Y, starSystem.Z);

                star.currentPoint = new Point3D(centerPoint.X - starSystem.X, centerPoint.Y - starSystem.Y, centerPoint.Z - starSystem.Z);

                star.distance = calculateDistance(centerPoint, star.originPoint);

                star.BuildName();

                star.InitStar();

               // star.SetSize();

               // star.SetColor();

             //   star.ShowNames();

                tempList.Add(star);

            }

            return tempList;
        }
예제 #2
0
        public void Animator_Tick(object sender, EventArgs e)
        {
            if (!starOverlay)
            {

                RenderOverlay.overlayStar.Children.Clear();

                double rotateStep = 0.36;

                renderStarSystems.rotatorPoint.Z += rotateStep;

                if (renderStarSystems.rotatorPoint.Z > 360)
                {
                    renderStarSystems.rotatorPoint.Z = 0;
                }
            }

            if (starOverlay && starOverlayID != -1)
            {
                int index = starSystemCollection.FindIndex(fetchID => fetchID.starID == starOverlayID);

                if (index != -1)
                {
                    Star overlayStar = new Star();

                    overlayStar.starID = starSystemCollection[index].starID;
                    overlayStar.name = starSystemCollection[index].name;

                    overlayStar.centerX = starSystemCollection[index].centerX;
                    overlayStar.centerY = starSystemCollection[index].centerY;

                    overlayStar.currentPoint = starSystemCollection[index].currentPoint;
                    overlayStar.rotaPoint = starSystemCollection[index].rotaPoint;

                    overlayStar.elevation = starSystemCollection[index].elevation;
                    overlayStar.azimuth = starSystemCollection[index].azimuth;

                    overlayStar.zoom = starSystemCollection[index].zoom;

                    overlayStar.InitStar();

                    overlayStar.BuildName();

                    overlayStar.Project3D();

                    overlayStar.size = 32;

                    overlayStar.setOverlay();

                    overlayStar.ShowNames();

                    overlayStar.SetColor();

                    RenderOverlay.overlayStar.Children.Clear();
                    RenderOverlay.overlayStar.Children.Add(overlayStar.starCanvas);

                    renderOverlay.UpdateOverlay(elevation, azimuth);
                    renderStarSystems.headerLabel.Content = overlayStar.originalName;
            }

            starOverlayID = -1;

            }
            renderStarSystems.UpdateRender(starSystemCollection);

            renderOverlay.UpdateOverlay(elevation, azimuth, renderStarSystems.rotatorPoint);
        }