public override Voxel GenerateVoxel(IntVector3 pos) { var distance = pos.DistanceTo(IntVector3.Zero); if (distance < half) return new Voxel { Weight = 255 }; /* var polarPos = SphericalPosition.FromCartesian(pos.X, pos.Y, pos.Z); if (polarPos.Radius < half) { //var noiseVal = (float)gen.GetValue(polarPos.Azimuth, polarPos.Inclination, Seed); //var radHere = (float)(noiseVal + 1f / 2f) * Size; //if (radHere < half) return new Voxel(1f); } // the easy way to generate a sphere //if(pos.DistanceTo(IntVector3.Zero) < half) // return new Voxel(1f); */ return Voxel.Empty; }
public override Voxel GenerateVoxel(IntVector3 pos) { var distance = pos.DistanceTo(IntVector3.Zero); if (distance < Size) return new Voxel { Weight = 255 }; return Voxel.Empty; }