當前位置: 首頁>>代碼示例>>C#>>正文


C# Media3D.Point3D類代碼示例

本文整理匯總了C#中System.Windows.Media.Media3D.Point3D的典型用法代碼示例。如果您正苦於以下問題:C# Point3D類的具體用法?C# Point3D怎麽用?C# Point3D使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Point3D類屬於System.Windows.Media.Media3D命名空間,在下文中一共展示了Point3D類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Create

        public Model3DGroup Create(Color modelColor,string pictureName, Point3D startPos, double maxHigh)
        {
            try
            {
                Uri inpuri = new Uri(@pictureName, UriKind.Relative);
                BitmapImage bi = new BitmapImage();
                bi.BeginInit();
                bi.UriSource = inpuri;
                bi.EndInit();
                ImageBrush imagebrush = new ImageBrush(bi);
                imagebrush.Opacity = 100;
                imagebrush.Freeze();

                Point[] ptexture0 = { new Point(0, 0), new Point(0, 1), new Point(1, 0) };
                Point[] ptexture1 = { new Point(1, 0), new Point(0, 1), new Point(1, 1) };

                SolidColorBrush modelbrush = new SolidColorBrush(modelColor);
                Model3DGroup cube = new Model3DGroup();
                Point3D uppercircle = startPos;
                modelbrush.Freeze();
                uppercircle.Y = startPos.Y + maxHigh;
                cube.Children.Add(CreateEllipse2D(modelbrush, uppercircle, _EllipseHigh, new Vector3D(0, 1, 0)));
                cube.Children.Add(CreateEllipse2D(modelbrush, startPos, _EllipseHigh, new Vector3D(0, -1, 0)));
                cube.Children.Add(CreateEllipse3D(imagebrush, startPos, _EllipseHigh, maxHigh, ptexture0));
                return cube;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
開發者ID:kse-jp,項目名稱:RM-3000,代碼行數:31,代碼來源:EllipseModel.cs

示例2: SetPoint

 internal static void SetPoint(this User user, JointID joint, Point3D newPoint)
 {
     switch (joint)
     {
         case JointID.Head:
             user.Head = newPoint;
             break;
         case JointID.AnkleLeft:
             user.AnkleLeft = newPoint;
             break;
         case JointID.ElbowLeft:
             user.ElbowLeft = newPoint;
             break;
         case JointID.FootLeft:
             user.FootLeft = newPoint;
             break;
         case JointID.HandLeft:
             user.HandLeft = newPoint;
             break;
         case JointID.KneeLeft:
             user.KneeLeft = newPoint;
             break;
         case JointID.ShoulderLeft:
             user.ShoulderLeft = newPoint;
             break;
         case JointID.HipLeft:
             user.HipLeft = newPoint;
             break;
         case JointID.ShoulderCenter:
             user.ShoulderCenter = newPoint;
             break;
         case JointID.AnkleRight:
             user.AnkleRight = newPoint;
             break;
         case JointID.ElbowRight:
             user.ElbowRight = newPoint;
             break;
         case JointID.FootRight:
             user.FootRight = newPoint;
             break;
         case JointID.HandRight:
             user.HandRight = newPoint;
             break;
         case JointID.KneeRight:
             user.KneeRight = newPoint;
             break;
         case JointID.HipRight:
             user.HipRight = newPoint;
             break;
         case JointID.ShoulderRight:
             user.ShoulderRight = newPoint;
             break;
         case JointID.Spine:
             user.Spine = newPoint;
             break;
         case JointID.HipCenter:
             user.HipCenter = newPoint;
             break;
     }
 }
開發者ID:atosorigin,項目名稱:Kinect,代碼行數:60,代碼來源:FilterHelper.cs

示例3: CreateMesh

        protected override Geometry3D CreateMesh()
        {
            _radius = Radius;
            _position = Position;

            MeshGeometry3D mesh = new MeshGeometry3D();
            Point3D prevPoint = PointForAngle(0);
            Vector3D normal = new Vector3D(0, 0, 1);

            const int div = 180;
            for (int i = 1; i <= div; ++i)
            {
                double angle = 2 * Math.PI / div * i;
                Point3D newPoint = PointForAngle(angle);
                mesh.Positions.Add(prevPoint);
                mesh.Positions.Add(_position);
                mesh.Positions.Add(newPoint);
                mesh.Normals.Add(normal);
                mesh.Normals.Add(normal);
                mesh.Normals.Add(normal);
                prevPoint = newPoint;
            }

            mesh.Freeze();
            return mesh;
        }
開發者ID:Moiraines,項目名稱:TelerikAcademy,代碼行數:26,代碼來源:Circle.cs

示例4: BuildStarSystemCollection

        public List<StarSystem> BuildStarSystemCollection(Point3D midPoint, double range)
        {
            List<StarSystem> returnList = new List<StarSystem>();

            double minX = midPoint.X - range;
            double minY = midPoint.Y - range;
            double minZ = midPoint.Z - range;
            double maxX = midPoint.X + range;
            double maxY = midPoint.Y + range;
            double maxZ = midPoint.Z + range;

            foreach (var systemlist in milkyWay
                .Where(system => system.Location.X >= minX && system.Location.X <= maxX &&
                                 system.Location.Y >= minY && system.Location.Y <= maxY &&
                                 system.Location.Z >= minZ && system.Location.Z <= maxZ))
            {
                if (calculateDistance(midPoint, new Point3D(systemlist.Location.X, systemlist.Location.Y, systemlist.Location.Z)) <= range)
                {
                    returnList.Add(systemlist);
                }
            }

            centerPoint = midPoint;

            return returnList;
        }
開發者ID:saturnineNL,項目名稱:GMV,代碼行數:26,代碼來源:StarSystemSet.cs

示例5: Star

        public Star()
        {
            starColor = foregroundBrush;

            starGFX = new Ellipse();
            starSEL = new Ellipse();

            starCanvas = new Canvas();
            starLabel = new Label();

            starSEL.Visibility = Visibility.Hidden;
            starGFX.Fill = foregroundBrush;

            starLabel.FontFamily = new FontFamily(new Uri("pack://application:,,,/Fonts/"), "./#Euro Caps");
            starLabel.Foreground = fontBrush;

            starCanvas.Children.Add(starLabel);
            starCanvas.Children.Add(starGFX);
            starCanvas.Children.Add(starSEL);

            movePoint = new Point3D(0,0,0);
            rotaPoint = new Point3D(0,0,0);

            starCanvas.MouseLeftButtonDown += SetSelection;
            starCanvas.MouseRightButtonDown +=TargetSelection;

            starCanvas.MouseEnter += ShowInfoSelection;
            starCanvas.MouseLeave += HideInfoSelection;
        }
開發者ID:saturnineNL,項目名稱:GMV,代碼行數:29,代碼來源:Star.cs

示例6: KinectV1Settings

        public KinectV1Settings(string uniqueID, int kinectNumber)
        {
            uniqueKinectID = uniqueID;
            kinectID = kinectNumber;

            //Set everything to the default value
            colorImageMode = ColorImageFormat.RgbResolution640x480Fps30;
            lineFrequency = PowerLineFrequency.SixtyHertz;
            autoWhiteBalance = true;
            autoExposure = true;
            backlightMode = BacklightCompensationMode.AverageBrightness;
            depthImageMode = DepthImageFormat.Resolution320x240Fps30;
            isNearMode = false;
            irON = true;
            scaleDepthToReliableRange = false;
            colorizeDepth = false;
            mergeSkeletons = false;
            kinectPosition = new Point3D(0, 0, 0);
            kinectYaw = 0.0;
            sendAcceleration = false;
            sendAudioAngle = false;
            audioTrackMode = AudioTrackingMode.Loudest;
            sendColorImage = false;
            sendDepthImage = false;

            //Setup the options for the raw skeleton, irrespective of use
            rawSkeletonSettings = new SkeletonSettings();
        }
開發者ID:vancegroup,項目名稱:KVR,代碼行數:28,代碼來源:KinectV1Settings.cs

示例7: GetPoints

        public static Point3D[] GetPoints(int count, Point3D[] controlPoints)
        {
            #region asserts
#if DEBUG
            if (controlPoints.Length < 2)
            {
                throw new ArgumentException("There must be at least two points passed in: " + controlPoints.Length.ToString());
            }
#endif
            #endregion

            double countD = count - 1;

            Point3D[] retVal = new Point3D[count];

            retVal[0] = controlPoints[0];
            retVal[count - 1] = controlPoints[controlPoints.Length - 1];

            for (int cntr = 1; cntr < count - 1; cntr++)
            {
                retVal[cntr] = GetPoint(cntr / countD, controlPoints);
            }

            return retVal;
        }
開發者ID:charlierix,項目名稱:AsteroidMiner,代碼行數:25,代碼來源:Bezier.cs

示例8: WWLineSegment

 public WWLineSegment(Point3D startPos, Vector3D dirNormalized, double length, double intensity)
 {
     StartPos = startPos;
     Direction = dirNormalized;
     Length = length;
     Intensity = intensity;
 }
開發者ID:kekyo,項目名稱:PlayPcmWin,代碼行數:7,代碼來源:WWLineSegment.cs

示例9: ExplodingMesh

        public ExplodingMesh(MeshGeometry3D inputMesh, Point3D hitpos)
        {
            var mesh = MeshGeometryHelper.NoSharedVertices(inputMesh);

            double cx, cy, cz;
            cx = cy = cz = 0;
            for (int i = 0; i < mesh.Positions.Count; i++)
            {
                cx += mesh.Positions[i].X;
                cy += mesh.Positions[i].Y;
                cz += mesh.Positions[i].Z;
            }
            int n = mesh.Positions.Count;
            var center = new Point3D(cx / n, cy / n, cz / n);

            integrator = new VerletIntegrator();
            integrator.Resize(mesh.Positions.Count);
            var r = new Random();
            for (int i = 0; i < mesh.Positions.Count; i++)
            {
                var delta = mesh.Positions[i] - center;
                delta.Normalize();
                integrator.Positions[i] = mesh.Positions[i] + delta * (1 + r.NextDouble() * 2);
                integrator.Positions0[i] = mesh.Positions[i];
                integrator.Accelerations[i] = new Vector3D(0, 0, -1000);
                integrator.InverseMass[i] = 0.01;
            }

            integrator.CreateConstraintsByMesh(mesh, 0.7);
            integrator.AddFloor(0.3);
            this.Mesh = mesh;
            watch.Start();
        }
開發者ID:chantsunman,項目名稱:helix-toolkit,代碼行數:33,代碼來源:MainWindow.xaml.cs

示例10: JointStatus

 public JointStatus()
 {
     position = new Point3D(0, 0, 0);
     speed = new Point3D(0, 0, 0);
     abs_speed = 0;
     angle = 0;
 }
開發者ID:flyfj,項目名稱:KinectStudio,代碼行數:7,代碼來源:MotionAssessor.cs

示例11: AddPlaneToMesh

        public static MeshGeometry3D AddPlaneToMesh(MeshGeometry3D mesh, Vector3D normal, Point3D upperLeft, Point3D lowerLeft, Point3D lowerRight, Point3D upperRight)
        {
            int offset = mesh.Positions.Count;

            mesh.Positions.Add(upperLeft);
            mesh.Positions.Add(lowerLeft);
            mesh.Positions.Add(lowerRight);
            mesh.Positions.Add(upperRight);

            mesh.Normals.Add(normal);
            mesh.Normals.Add(normal);
            mesh.Normals.Add(normal);
            mesh.Normals.Add(normal);

            mesh.TextureCoordinates.Add(new Point(0, 0));
            mesh.TextureCoordinates.Add(new Point(0, 1));
            mesh.TextureCoordinates.Add(new Point(1, 1));
            mesh.TextureCoordinates.Add(new Point(1, 0));

            mesh.TriangleIndices.Add(offset + 0);
            mesh.TriangleIndices.Add(offset + 1);
            mesh.TriangleIndices.Add(offset + 2);
            mesh.TriangleIndices.Add(offset + 0);
            mesh.TriangleIndices.Add(offset + 2);
            mesh.TriangleIndices.Add(offset + 3);

            return mesh;
        }
開發者ID:wjzhangb,項目名稱:Fantasy.Repositories,代碼行數:28,代碼來源:Plane.cs

示例12: drawTor

        public static void drawTor(Point3D center, double R, double r, int N, int n, Color color, Viewport3D mainViewport)
        {
            if (n < 2 || N < 2)
              {
            return;
              }

              Model3DGroup tor = new Model3DGroup();
              Point3D[,] points = new Point3D[N, n];

              for (int i = 0; i < N; i++)
              {
            for (int j = 0; j < n; j++)
            {
              points[i, j] = getPositionTor(R, r, i * 360 / (N - 1), j * 360 / (n - 1));
              points[i, j] += (Vector3D)center;
            }
              }

              Point3D[] p = new Point3D[4];
              for (int i = 0; i < N - 1; i++)
              {
            for (int j = 0; j < n - 1; j++)
            {
              p[0] = points[i, j];
              p[1] = points[i + 1, j];
              p[2] = points[i + 1, j + 1];
              p[3] = points[i, j + 1];
              drawTriangle(p[0], p[1], p[2], color, mainViewport);
              drawTriangle(p[2], p[3], p[0], color, mainViewport);

            }
              }
        }
開發者ID:Mexahoid,項目名稱:CSF,代碼行數:34,代碼來源:LoTVLogics.cs

示例13: FlipTile

        public FlipTile(DiffuseMaterial frontMaterial,
            Size size, Point center, Material backMaterial, Rect backTextureCoordinates)
        {
            m_locationDesired = new Point3D(center.X, center.Y, 0);
            m_locationCurrent = new Point3D(0, 0, Util.Rnd.NextDouble() * 10 - 20);
            m_size = size;

            Point3D topLeft = new Point3D(-size.Width / 2, size.Height / 2, 0);
            Point3D topRight = new Point3D(size.Width / 2, size.Height / 2, 0);
            Point3D bottomLeft = new Point3D(-size.Width / 2, -size.Height / 2, 0);
            Point3D bottomRight = new Point3D(size.Width / 2, -size.Height / 2, 0);

            m_frontMaterial = frontMaterial;

            Model3DGroup quad = new Model3DGroup();
            quad.Children.Add(
                CreateTile(
                    frontMaterial,
                    backMaterial,
                    m_borderMaterial,
                    new Size3D(size.Width, size.Height, .01),
                    backTextureCoordinates));

            Transform3DGroup group = new Transform3DGroup();

            group.Children.Add(new RotateTransform3D(m_verticalFlipRotation));
            group.Children.Add(new RotateTransform3D(m_quaternionRotation3D));

            group.Children.Add(m_scaleTransform);
            group.Children.Add(m_translate);

            quad.Transform = group;

            this.Visual3DModel = quad;
        }
開發者ID:hungdluit,項目名稱:bot,代碼行數:35,代碼來源:FlipTile.cs

示例14: YPitchBendCube

        public YPitchBendCube(Point3D center, double radius, 
                Pitch pitch, Instrument instrument, OutputDevice device, Channel channel)
            : base(center, radius, new InstrumentNoteAction(device, channel, pitch)) {

                outputDevice = device;
                this.channel = channel;
        }
開發者ID:probuilderz,項目名稱:balloon,代碼行數:7,代碼來源:YPitchBendCube.cs

示例15: TryTransform

        /// <summary>
        /// Transform a point
        /// </summary>
        /// <param name="inPoint">Input point</param>
        /// <param name="result">Output point</param>
        /// <returns>True if the point was transformed successfuly, false otherwise</returns>
        public bool TryTransform(Point inPoint, out Point3D result)
        {
            Point final2DPoint;

            // assign this now so that we can return false if needed
            result = new Point3D();
            
            if (!_transform2D.TryTransform(inPoint, out final2DPoint))
            {
                return false;
            }
                       
            Point texCoord = Viewport2DVisual3D.VisualCoordsToTextureCoords(final2DPoint, _childBounds);

            // need to walk the texture coordinates on the Viewport2DVisual3D
            // and look for where this point intersects one of them
            Point3D coordPoint;
            if (!Viewport2DVisual3D.Get3DPointFor2DCoordinate(texCoord, 
                                                            out coordPoint,
                                                            _positions,
                                                            _textureCoords,
                                                            _triIndices))
            {
                return false;
            }

            if (!_transform3D.TryTransform(coordPoint, out result))
            {
                return false;
            }
            
            return true;
        }
開發者ID:JianwenSun,項目名稱:cc,代碼行數:39,代碼來源:GeneralTransform2DTo3D.cs


注:本文中的System.Windows.Media.Media3D.Point3D類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。