Hi Agnes, The osgUtil::DelaunayTriangulator uses a 2D projection for the tessellation so is unable to tessellation point clouds whether there are overhangs - such as a sphere. The osgUtil::Tessellator use GLU tessellation, which also uses a 2D projection for it's tessellations.
There aren't any tools in the OSG for tessellating a 3D point cloud, so you with will need to find a 3rd party tool to tessellate your points, or just work out how to do the tessellation directly yourself. For the case of sphere you could probably come up with a technique that knows that you are building a sphere and the structure of the points to guide the tessellation. Robert. On Mon, Oct 25, 2010 at 3:15 PM, <[email protected]> wrote: > Hi all, > currently I am writing my bachelor's thesis and I am programming in OSG. > Consequently, I am a so-called newbie. > > Via 2 while-loops, which traverse the parametric representation of a unit > sphere around the origin, I receive supporting points. Singular points are > added manually. > I want to triangulate these supporting points to approximate the surface of > a unit sphere. > Therefore I pass a DelaunayTriangulator object my pointcloud (ca. 400points) > and call its triangulate() method. > > However, only the lower hemisphere is always triangulated. I tried to > translate the parametric representation, along the positive z-axis so that > there are no negative values for the coordinates. Even this does not change > the result. > I also tried to change the traversal of both for-loops but this did not > produce other results ,too. > > At division of my pointcloud in two clouds (each ca. 400 points), one for > the lower and the other for the upper hemisphere, the triangulation works > without any problems. > > Does anybody know the reason for my problem, or what am I doing wrong? > > My code: > ---------------------------------------------------------------------------------------------------------- > > geom= new Geometry(); > objGeode_ = new Geode(); > objGeode_->addDrawable(geom); > objGeode_->setNodeMask(objGeode_->getNodeMask() & (~Isect::Intersection) > & (~Isect::Pick)); > rootNode->addChild(objGeode_); > > //--------------------- array of > vertices--------------------------------- > int numVertices = 20; > double firstA = 0.0; > double firstB = 0.0; > double radian = 1.0; > int counterA; > int counterB; > > Vec3Array *vecTriangArray = new Vec3Array; > > //singular points > vecTriangArray->push_back(Vec3(0.0, 0.0, 1.0)); > vecTriangArray->push_back(Vec3(0.0, 0.0, -1.0)); > > //Traverse the latitude then along the meridian > counterA = 1; > firstA =(PI / numVertices)*counterA; > > while(firstA < PI){ > counterB = 0; > firstB = 0.0; > > while(firstB < 2*PI){ > double x = radian * sin(firstA) * cos(firstB); > double y = radian * sin(firstA) * sin(firstB); > double z = radian * cos(firstA); > vecTriangArray->push_back(Vec3(x, y, z)); > counterB++; > firstB = (2*PI / numVertices)*counterB; > } > counterA ++; > firstA =(PI / numVertices)*counterA; > } > > geom -> setVertexArray(vecTriangArray); > > //---------------Delaunay Triangulator------------- > DelaunayTriangulator *trig = new DelaunayTriangulator(); > trig -> setInputPointArray(vecTriangArray); > > //triangulate the points an add them to the primitive set > trig->triangulate(); > geom->addPrimitiveSet(trig->getTriangles()); > > ---------------------------------------------------------------------------------------------------------- > > Thank you, > > Agnes > > > -- > Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief! > Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

