Subject: CGAL users discussion list
List archive
- From: Bo Zhou <>
- To:
- Subject: Re: [cgal-discuss] Random Point on Sphere
- Date: Sun, 16 Aug 2009 12:07:10 +0800
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=SPri1Ob/lVxEyLmkf8hT3/FZabXGdIsK4+KGCHrdy3POf+1iEror1qb2s1YGJvWmnH u7quzTBGXa8vZPtESp0TBkcez3aIaQA4eFyl7THTOc67tLTH2nBDNOCiyBtKfc8niK1Z CAsH4RJZrOeaVODm02e74onPzQVl6dnQDd0kk=
wrote:
I am a student and would like to learn more about CGAL, but I'm havingHello,
difficulties. according to the example: demo/Convex_hull_3/incremental_hull_3_demo.cpp
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
int main ()
{
Convex_hull_3 CH(3); // create instance of the class with dimension == 3
// generate 250 points randomly on a sphere of radius 100
// and insert them into the convex hull
CGAL::Random_points_in_sphere_3<Point_3, Creator> gen(100);
for (int i = 0; i < 250 ; i++, ++gen)
CH.insert(*gen);
assert(CH.is_valid());
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Point_3 p(int x,int y,int z);
CGAL::Random_points_in_sphere_3<p, Creator> gen(100);
the above statement is wrong, how to implement????
I would like to generate points for two balls, but he always puts the points
in
origin. So d would include the items in the coordinates (x, Y, Z) that I set.
how make?
thaks!
Leandro
You should consider the point set on sphere generated by CGAL is in a *Local Coordinates.* If you want to generate to separated two balls, you should translate the points on sphere by multiply a translate matrix in order to "move rotate scale" the ball. Take one OpenGL book for more information about coordinates transformation.
--
/**
* Bo Zhou
* Blog : http://jedimaster.cnblogs.com
* Mobile : +86 13451813691
*/
- [cgal-discuss] Random Point on Sphere, lgazoni, 08/16/2009
- Re: [cgal-discuss] Random Point on Sphere, Bo Zhou, 08/16/2009
Archive powered by MHonArc 2.6.16.