示例#1
0
		private void AddSphereAndBox()
		{
			// setup a solid reflecting sphere
			double radius = 1.5;
			BaseShape bigSphere = new SphereShape(new Vector3(1, 4, -3), radius, new SolidMaterial(new RGBA_Floats(0, .5, .5), 0.2, 0.0, 2.0));
			renderCollection.Add(bigSphere);

			BoxShape box = new BoxShape(new Vector3(-1, 0, -4), new Vector3(1, 2, -2),
							   new SolidMaterial(new RGBA_Floats(.9, .2, .1), .01, 0.0, 2.0));
			renderCollection.Add(box);
		}
示例#2
0
		private void AddCubeOfShperes()
		{
			List<IPrimitive> scanData1 = new List<IPrimitive>();
			Random rand = new Random(0);
			double dist = 2;
			for (int i = 0; i < 4000; i++)
			{
				BaseShape littleShpere = new SphereShape(new Vector3(rand.NextDouble() * dist - dist / 2, rand.NextDouble() * dist - dist / 2, rand.NextDouble() * dist - dist / 2),
					rand.NextDouble() * .1 + .01,
					new SolidMaterial(new RGBA_Floats(rand.NextDouble() * .5 + .5, rand.NextDouble() * .5 + .5, rand.NextDouble() * .5 + .5), 0, 0.0, 2.0));
				scanData1.Add(littleShpere);
			}

			renderCollection.Add(BoundingVolumeHierarchy.CreateNewHierachy(scanData1));
		}