当前位置: 首页>>代码示例>>C#>>正文


C# Point3类代码示例

本文整理汇总了C#中Point3的典型用法代码示例。如果您正苦于以下问题:C# Point3类的具体用法?C# Point3怎么用?C# Point3使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Point3类属于命名空间,在下文中一共展示了Point3类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: constructor_default

        public void constructor_default() {
            var p = new Point3();

            Assert.Equal(0, p.X);
            Assert.Equal(0, p.Y);
            Assert.Equal(0, p.Z);
        }
开发者ID:aarondandy,项目名称:vertesaur,代码行数:7,代码来源:Point3Facts.cs

示例2: CalculateHit

		public RenderItem CalculateHit (Ray ray, out double tHit, double maxT) {
			Point3 inter = new Point3(ray.Offset);
			double t = 0.0d;
			tHit = maxT;
			if(x0 > inter.X || inter.X > x1 || y0 > inter.Y || inter.Y > y1 || z0 > inter.Z || inter.Z > z1) {
				Utils.CalculateBoxHitpoint(ray, inter, out t, this.x0, this.x1, this.y0, this.y1, this.z0, this.z1);
				if(t >= tHit) {
					return null;
				}
			}
			RenderItem ri = null;
			double[] seqxyz = new double[] {
				Maths.SoftInv(ray.DX),
				Maths.SoftInv(ray.DY),
				Maths.SoftInv(ray.DZ),
				x0,
				x1,
				x1,
				y0,
				y1,
				y1,
				z0,
				z1,
				z1
			};
			int dpos = Maths.BinarySign(ray.DX)|(Maths.BinarySign(ray.DY)<<0x02)|(Maths.BinarySign(ray.DZ)<<0x04);
			proceedSubTree(ray, dpos, seqxyz, inter, ref ri, ref t, ref tHit, this.root);
			return ri;
		}
开发者ID:KommuSoft,项目名称:MoRen,代码行数:29,代码来源:OctTreeAccelerator.cs

示例3: GetBlock

 public static Voxel GetBlock(Point3 worldBlockCoord)
 {
     Chunk chunk = GetChunk(worldBlockCoord);
     return chunk != null
         ? chunk.Get(worldBlockCoord.ToLocalBlockCoord())
         : null;
 }
开发者ID:mandarinx,项目名称:buildahouse,代码行数:7,代码来源:ChunkManager.cs

示例4: Copy

 public void Copy(double t, Point3 norm, double tu, double tv)
 {
     this.T = t;
     this.Normal.SetValues(norm);
     this.TU.X = tu;
     this.TU.Y = tv;
 }
开发者ID:KommuSoft,项目名称:MoRen,代码行数:7,代码来源:CastResult.cs

示例5: Quadrilateral

        public Quadrilateral(Point3 TopLeftIn, Point3 TopRightIn, Point3 BottomLeftIn, Point3 BottomRightIn)
        {
            this.TopLeft = TopLeftIn;
            this.TopRight = TopRightIn;
            this.BottomLeft = BottomLeftIn;
            this.BottomRight = BottomRightIn;

            Plane3 plane = new Plane3(this.TopLeft, this.TopRight, this.BottomLeft);
            //Vector3 ab = new Vector3(new Segment3(this.BottomLeft, this.TopLeft));
            //Vector3 ac = new Vector3(new Segment3(this.BottomLeft, this.BottomRight));
            //Vector3 normal = Vector3.Cross(ab, ac);
            //Vector3 ad = new Vector3(new Segment3(this.BottomLeft, this.TopRight));
            //double dotp = Vector3.Dot(ad, normal);

            //PetrelLogger.InfoOutputWindow("The dot product of this cell's face is " + System.Convert.ToString(dotp));

            if (Plane3Extensions.Contains(plane,this.BottomRight, 1E-7))
            {
                LeftSegment = new Segment3(this.TopLeft, this.BottomLeft);
                RightSegment = new Segment3(this.TopRight, this.BottomRight);
                BottomSegment = new Segment3(this.BottomLeft, this.BottomRight);
                TopSegment = new Segment3(this.TopLeft, this.TopRight);

                CalculateCentroid();
            }
            else
            {   double x = (this.TopLeft.X + this.BottomLeft.X + this.TopRight.X + this.BottomRight.X) / 4.0;
                double y = (this.TopLeft.Y + this.BottomLeft.Y + this.TopRight.Y + this.BottomRight.Y) / 4.0;
                double z = (this.TopLeft.Z + this.BottomLeft.Z + this.TopRight.Z + this.BottomRight.Z) / 4.0;

                this.Centroid = new Point3(x,y,z);
            }
        }
开发者ID:walter-poquioma,项目名称:ModifiedKh,代码行数:33,代码来源:Quadrilateral.cs

示例6: coordinate_triple_coordinate_get_test

 public void coordinate_triple_coordinate_get_test() {
     ICoordinateTriple<double> p = new Point3(3, 4, 5);
     var a = new Vector3(p);
     Assert.Equal(3, a.X);
     Assert.Equal(4, a.Y);
     Assert.Equal(5, a.Z);
 }
开发者ID:aarondandy,项目名称:vertesaur,代码行数:7,代码来源:Vector3Facts.cs

示例7:

        bool IGeometryGeneratorSource.CanBuildSide(BlockData me, BlockData side, Point3 mePos, Point3 sidePos)
        {
            if (IsFence(side))
                return false;

            return !side.IsSolid;
        }
开发者ID:robot9706,项目名称:MinecraftModelExporter,代码行数:7,代码来源:Fence.cs

示例8: ProxyTriangle

 public ProxyTriangle(RenderItem t, Point3 pa, Point3 pb, Point3 pc)
     : base(t)
 {
     this.pa = pa;
     this.pb = pb;
     this.pc = pc;
 }
开发者ID:KommuSoft,项目名称:MoRen,代码行数:7,代码来源:ProxyTriangle.cs

示例9: Load

 public override void Load(string currentDir, string filename)
 {
     TreeNode<string> tree = filename.ParseTreeBracketsComma();
     if(tree.Count < 0x03) {
         pa = Point3.DummyPoint;
         pb = Point3.DummyXPoint;
         pc = Point3.DummyYPoint;
     }
     else {
         pa = Point3.Parse(tree[0x00].ChildDatas);
         pb = Point3.Parse(tree[0x01].ChildDatas);
         pc = Point3.Parse(tree[0x02].ChildDatas);
     }
     if(tree.Count >= 0x06) {
         na = Point3.Parse(tree[0x03].ChildDatas);
         nb = Point3.Parse(tree[0x04].ChildDatas);
         nc = Point3.Parse(tree[0x05].ChildDatas);
     }
     if(tree.Count >= 0x09) {
         ta = Point3.Parse(tree[0x06].ChildDatas);
         tb = Point3.Parse(tree[0x07].ChildDatas);
         tc = Point3.Parse(tree[0x08].ChildDatas);
     }
     else {
         ta = Point3.DummyYPoint;
         tb = Point3.DummyPoint;
         tc = Point3.DummyXPoint;
     }
 }
开发者ID:KommuSoft,项目名称:MoRen,代码行数:29,代码来源:TriangleLoader.cs

示例10: Multiply

 /// <summary>
 /// Multiplies the point by the specified matrix.
 /// </summary>
 internal static Point3 Multiply(Matrix m, Point3 p)
 {
     return new Point3(
         m.m11 * p.X + m.m12 * p.Y + m.m13 * p.Z,
         m.m21 * p.X + m.m22 * p.Y + m.m23 * p.Z,
         m.m31 * p.X + m.m32 * p.Y + m.m33 * p.Z);
 }
开发者ID:Kyle0654,项目名称:Portal2.Puzzle,代码行数:10,代码来源:Matrix.cs

示例11: CreatingPolyLineListWhenWellHasPerforations

        public static List<IPolyline3> CreatingPolyLineListWhenWellHasPerforations(Borehole bh)
        {
            List<IPolyline3> plineList = new List<IPolyline3>();

            foreach (Perforation prf in bh.Completions.Perforations)
            {
                double x1 = bh.Transform(Domain.MD, prf.StartMD, Domain.X);
                double y1 = bh.Transform(Domain.MD, prf.StartMD, Domain.Y);
                double z1 = bh.Transform(Domain.MD, prf.StartMD, Domain.ELEVATION_DEPTH);

                List<Point3> ptsList = new List<Point3>();
                Point3 pt3_1 = new Point3(x1, y1, z1);
                ptsList.Add(pt3_1);

                double x2 = bh.Transform(Domain.MD, prf.EndMD, Domain.X);
                double y2 = bh.Transform(Domain.MD, prf.EndMD, Domain.Y);
                double z2 = bh.Transform(Domain.MD, prf.EndMD, Domain.ELEVATION_DEPTH);

                Point3 pt3_2 = new Point3(x2, y2, z2);

                double xmiddle = (x1 + x2)/2;
                double ymiddle = (y1 + y2) / 2;
                double zmiddle = (z1 + z2) / 2;

                Point3 pt3_3 = new Point3(xmiddle, ymiddle, zmiddle);
                ptsList.Add(pt3_3);
                ptsList.Add(pt3_2);

                IPolyline3 pline = new Polyline3(ptsList);

                plineList.Add(pline);
            }

            return plineList;
        }
开发者ID:walter-poquioma,项目名称:ModifiedKh,代码行数:35,代码来源:KandaIntersectionService.cs

示例12: AddBlock

 public Voxel AddBlock(Point3 localBlockCoord)
 {
     voxels[localBlockCoord.x,
            localBlockCoord.y,
            localBlockCoord.z] = new Voxel();
     return Get(localBlockCoord);
 }
开发者ID:mandarinx,项目名称:buildahouse,代码行数:7,代码来源:Chunk.cs

示例13: CalculateHit

 public RenderItem CalculateHit(Ray ray, out double tHit, double maxT)
 {
     Point3 inter = new Point3(ray.Offset);
     tHit = maxT;
     double t = 0.0d;
     if(x0 > inter.X || inter.X > x1 || y0 > inter.Y || inter.Y > y1 || z0 > inter.Z || inter.Z > z1) {
         Utils.CalculateBoxHitpoint(ray, inter, out t, this.x0, this.x1, this.y0, this.y1, this.z0, this.z1);
         if(t > maxT) {
             return null;
         }
     }
     Point3 inter2 = new Point3(Maths.ZeroInv(ray.DX), Maths.ZeroInv(ray.DY), Maths.ZeroInv(ray.DZ));
     double tt = Maths.SoftInv(ray.DX)*(box[Maths.BinarySign(ray.DX)]-ray.X0);
     if(tt < tHit) {
         tHit = tt;
     }
     tt = Maths.SoftInv(ray.DY)*(box[Maths.BinarySign(ray.DY)+0x02]-ray.Y0);
     if(tt < tHit) {
         tHit = tt;
     }
     tt = Maths.SoftInv(ray.DZ)*(box[Maths.BinarySign(ray.DZ)+0x04]-ray.Z0);
     if(tt < tHit) {
         tHit = tt;
     }
     RenderItem ri = null;
     this.root.Hit(ray, inter2, inter, ref t, ref tHit, ref ri);
     return ri;
 }
开发者ID:KommuSoft,项目名称:MoRen,代码行数:28,代码来源:BinarySpacePartitionAccelerator.cs

示例14: constructor_coordinates

        public void constructor_coordinates() {
            var p = new Point3(1, 2, 3);

            Assert.Equal(1, p.X);
            Assert.Equal(2, p.Y);
            Assert.Equal(3, p.Z);
        }
开发者ID:aarondandy,项目名称:vertesaur,代码行数:7,代码来源:Point3Facts.cs

示例15: GetCornerSet

        //public static Slb.Ocean.Petrel.DomainObject.PillarGrid.Zone GetZone(Index3 cellIndex, List<Slb.Ocean.Petrel.DomainObject.PillarGrid.Zone> Zones)//List<Slb.Ocean.Petrel.DomainObject.PillarGrid.Zone> TopZone)
        //{
        //    foreach (Slb.Ocean.Petrel.DomainObject.PillarGrid.Zone zone in Zones)
        //    {
        //        if (cellIndex.K > zone.BaseK && cellIndex.K)
        //       {
        //       }
        //    }
        //}
        public static Point3[] GetCornerSet(CellSide SideOfCell, Grid gridInContext, Index3 CellIndex)
        {
            CellCorner[] CellCorners = new CellCorner[4];
            Point3[] CellCornerPoints = new Point3[4];

            switch (SideOfCell)
            {
                case CellSide.Up:
                    CellCorners[0] = CellCorner.TopNorthWest; CellCorners[1] = CellCorner.TopNorthEast; CellCorners[2] = CellCorner.TopSouthWest;
                    CellCorners[3] = CellCorner.TopSouthEast;
                    CellCornerPoints = gridInContext.GetCellCorners(CellIndex, CellCorners);

                    break;

                case CellSide.East:
                    CellCorners[0] = CellCorner.TopSouthEast; CellCorners[1] = CellCorner.TopNorthEast; CellCorners[2] = CellCorner.BaseSouthEast;
                    CellCorners[3] = CellCorner.BaseNorthEast;
                    CellCornerPoints = gridInContext.GetCellCorners(CellIndex, CellCorners);

                    break;

                case CellSide.West:

                    CellCorners[0] = CellCorner.TopSouthWest; CellCorners[1] = CellCorner.TopNorthWest; CellCorners[2] = CellCorner.BaseSouthWest;
                    CellCorners[3] = CellCorner.BaseNorthWest;
                    CellCornerPoints = gridInContext.GetCellCorners(CellIndex, CellCorners);

                    break;

                case CellSide.South:
                    CellCorners[0] = CellCorner.TopSouthWest; CellCorners[1] = CellCorner.TopSouthEast; CellCorners[2] = CellCorner.BaseSouthWest;
                    CellCorners[3] = CellCorner.BaseSouthEast;
                    CellCornerPoints = gridInContext.GetCellCorners(CellIndex, CellCorners);

                    break;

                case CellSide.North:

                    CellCorners[0] = CellCorner.TopNorthWest; CellCorners[1] = CellCorner.TopNorthEast; CellCorners[2] = CellCorner.BaseNorthWest;
                    CellCorners[3] = CellCorner.BaseNorthEast;
                    CellCornerPoints = gridInContext.GetCellCorners(CellIndex, CellCorners);

                    break;

                case CellSide.Down:

                    CellCorners[0] = CellCorner.BaseNorthWest; CellCorners[1] = CellCorner.BaseNorthEast; CellCorners[2] = CellCorner.BaseSouthWest;
                    CellCorners[3] = CellCorner.BaseSouthEast;
                    CellCornerPoints = gridInContext.GetCellCorners(CellIndex, CellCorners);

                    break;
                default:

                    CellCornerPoints = null;
                    break;
            }

            return CellCornerPoints;
        }
开发者ID:walter-poquioma,项目名称:ModifiedKh,代码行数:68,代码来源:KandaIntersectionService.cs


注:本文中的Point3类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。