예제 #1
0
        void WHD_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)//鼠标立起来
        {
            //ExtendUtils.WHD.MouseLeftButtonUp -= WHD_MouseLeftButtonUp;
            //ExtendUtils.WHD.MouseMove -= WHD_MouseMove;

            this.MouseLeftButtonUp -= WHD_MouseLeftButtonUp;
            this.MouseMove         -= WHD_MouseMove;

            _3dgrid.MouseLeftButtonDown += MianWall_MouseLeftButtonDown;
            for (int i = -3; i < 4; i++)
            {
                if (e.GetPosition(this).X == Start.X)
                {
                    _block3d = HitObject <Block3d>(e.GetPosition(this));
                    if (_block3d != null)
                    {
                        if (ItemClick != null)
                        {
                            ItemClick(this, new ItemclickEventArg()
                            {
                                MEDIA = _block3d.InFo
                            });
                        }
                    }
                    break;
                }
            }
            CompositionTarget.Rendering -= CompositionTarget_Rendering;
            CompositionTarget.Rendering += CompositionTarget_Rendering;
        }
예제 #2
0
        private static int MESH_COUNT = 87;                                //块个数
        private void CreatWall()                                           //创建墙体
        {
            double       radianIncrement = -.217;                          // mesh 位置分配增量(度)
            double       startDegrees    = -270;                           //环形起始度数
            double       startRadians    = DegreesToRadians(startDegrees); //度数转换为弧度
            double       radians         = startRadians;                   // 弧度
            double       radius          = 20;                             //半径
            double       height          = 15;                             //最底层块高度
            Block3d      block3d;
            LocationInfo loacation;

            for (int i = 0; i < MESH_COUNT; i++)   //
            {
                Point3D p       = CalculateRingPoint(radians, radius, height);
                double  degrees = -1 * (RadiansToDegrees(radians) - startDegrees);
                loacation = new LocationInfo(p, degrees, i);
                block3d   = new Block3d(loacation);
                _BlockList.Add(block3d);
                _viewport3d.Children.Add(block3d);
                radians += radianIncrement;
                if ((i + 1) % 29 == 0)
                {
                    radians = startRadians;
                    height += 3.5;
                }
            }
        }