add fake poisson-disk sampling
This commit is contained in:
parent
5c6c7cafd5
commit
99e6ea5dd6
|
@ -592,6 +592,26 @@ static void SingleFaceRaster(FaceType &f, VertexSampler &ps, const Point2<Scala
|
|||
}
|
||||
}
|
||||
|
||||
/// Compute a Poisson-disk sampling of the surface
|
||||
/// The radius of the disk is computed according to the estimated sampling density.
|
||||
static void Poissondisk(MetroMesh &m, VertexSampler &ps, int sampleNum)
|
||||
{
|
||||
FaceIterator fi;
|
||||
|
||||
// first of all computed r
|
||||
ScalarType meshArea = Stat<MetroMesh>::ComputeMeshArea(m);
|
||||
ScalarType r = sqrt(meshArea / (0.7 * 3.1415 * sampleNum)); // 0.7 is a density factor
|
||||
|
||||
for (fi = m.face.begin(); fi != m.face.end(); fi++)
|
||||
{
|
||||
ps.AddFace(*fi, RandomBaricentric());
|
||||
}
|
||||
|
||||
for (int i = 0; i < sampleNum; i++)
|
||||
{
|
||||
//...TODO...
|
||||
}
|
||||
}
|
||||
|
||||
//template <class MetroMesh>
|
||||
//void Sampling<MetroMesh>::SimilarFaceSampling()
|
||||
|
|
Loading…
Reference in New Issue