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

Ivan DeWolf ivan at martian-labs.com
Thu Feb 18 18:23:25 EST 2010



you should make your points first. Make 8 points. set their locations.
Then you make the 6 polygons.
When you make each polygon, you point it's vertices at the appropriate point.

when you are done, you will have 8 points, because you only ever made  
8 points.

you made them before you made your polygons.

in a loop before your facelist loop.

8 of them.

Quoting "katrin schmid" <Katisss at gmx.de>:

> hi,
> thanks a lot for this,
> unfortunately i still end up with 16 points in  a cube.
>     	  for (unsigned j = 0; j < m_faceList.size() ; j++)
>    	  {
>         	GU_PrimPoly* aFace = GU_PrimPoly::build(
>             		gdp,
>             		m_faceList[j].size(),
>             		GU_POLY_CLOSED,
>             		false);
>
>     		for(point_idx = 0; point_idx < m_faceList[j].size() ; point_idx++)
> 		{
> 		   aFace->setVertex(point_idx, added_points[ m_faceList[j][point_idx]] );
> 		}
> }
> Very strange,
> katrin
>
> -------- Original-Nachricht --------
>> Datum: Thu, 18 Feb 2010 14:44:24 -0800
>> Von: "Michael K. O\'Brien" <mobrien at pixar.com>
>> An: sidefx-houdini-list at sidefx.com
>> Betreff: Re: [Sidefx-houdini-list] build a poly mesh  
>> from	a	vertex	position	face connection list
>
>> 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
>> _______________________________________________
>> Sidefx-houdini-list mailing list
>> Sidefx-houdini-list at sidefx.com
>> https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
>
> --
> 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.



More information about the Sidefx-houdini-list mailing list