[Sidefx-houdini-list] build a poly mesh from a vertex position face connection list

Michael K. O'Brien mobrien at pixar.com
Thu Feb 18 17:44:24 EST 2010


Hola~

I end up creating the points using ::appendPoint.

Then I use the ::build method on the gprim I want (setting appendPoints to
false), but setting the vertex size correctly on ::build. I then set the verts
in a for loop:

    unsigned int aPointCount = ...;
    std::vector<GEO_Point*> pointLUT(aPointCount);
    for(all_points) {
        
        pointLUT[anIndex] = gdp->appendPoint();
        ++anIndex;
    }

    for(all_faces) {
        
        GU_PrimPoly* aFace = GU_PrimPoly::build(
            gdp,
            aVertPerFaceCount,
            GU_POLY_CLOSED,
            false);

        for(all_verts_on_face) {
            
            aFace->setVertex(i, pointLUT[aVertIndex]);
        }
    }

Houdini isn't super fast, but it's pretty reasonable.

MO

>-- On Thu, Feb 18, 2010 at 11:37:17PM +0100, katrin schmid wrote:
> hi,
> i am still a bit confused there are 
> is no build methode that takes a vertex and a connection list
> as in other APISs. Any examples around how to correctly build from vertex connection data?
> Regards,
> katrin 
> 
> 
> -------- Original-Nachricht --------
> > Datum: Thu, 18 Feb 2010 14:27:21 -0800
> > Von: "Ivan DeWolf" <ivan at martian-labs.com>
> > An: sidefx-houdini-list at sidefx.com
> > Betreff: Re: [Sidefx-houdini-list] build a poly mesh from a	vertex	position	face connection list
> 
> > 
> > you are creating a point for every vertex, yeah? don't you want to  
> > share some points across vertices? I usually create the points first,  
> > and then attach the poly's vertices to 'em....
> > 
> > Quoting "katrin schmid" <Katisss at gmx.de>:
> > 
> > > hi,
> > > switching on display points number shows i have indeed
> > > double the amount of points in the scene i should have.
> > > I draw the faces like this:
> > >
> > > prim_poly_ptr = dynamic_cast<GEO_PrimPoly  
> > > *>(gdp->appendPrimitive(GEOPRIMPOLY));
> > >     		prim_poly_ptr->setSize(0);
> > >
> > >     	for(point_idx = 0; point_idx < m_faceList[j].size() ; point_idx++)
> > > 		{
> > > 	   		prim_poly_ptr->appendVertex( added_points[
> > m_faceList[j][point_idx]] )
> > >
> > > Scary, any way to avoid this?
> > > Best Regards,
> > > katirn
> > > --
> > > GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
> > > Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
> > > _______________________________________________
> > > Sidefx-houdini-list mailing list
> > > Sidefx-houdini-list at sidefx.com
> > > https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
> > >
> > 
> > 
> > 
> > _______________________________________________________
> > Perfection is achieved when nothing else can be removed
> > -Yvon Chouinard
> > 
> > ----------------------------------------------------------------
> > This message was sent using IMP, the Internet Messaging Program.
> > _______________________________________________
> > Sidefx-houdini-list mailing list
> > Sidefx-houdini-list at sidefx.com
> > https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
> 
> -- 
> Sicherer, schneller und einfacher. Die aktuellen Internet-Browser -
> jetzt kostenlos herunterladen! http://portal.gmx.net/de/go/atbrowser
> _______________________________________________
> Sidefx-houdini-list mailing list
> Sidefx-houdini-list at sidefx.com
> https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list

-- 
Michael O'Brien                                                         Tools
Pixar                                                       mobrien at pixar.com

Censorship is the mother of metaphor.
                            -Jorges Luis Borges



More information about the Sidefx-houdini-list mailing list