Building a cube using HDK
briank at hero.com
Thu Jul 8 20:36:18 EDT 2004
I like to create the points first, then assign the polygon verticies to
the points, i.e.:
// add points to gdp:
// '0' in the following line means don't append points to gdp:
poly = GU_PrimPoly::build(gdp, numVerts, GU_POLY_CLOSED, 0);
// assign vertecies to points & set point locations:
for (i=0; i<numVerts; i++)
poly->getVertex(i) = the.correct.gdp.point();
This way you don't get duplicate points.
On Thu, 8 Jul 2004, Gerome Mortelecque wrote:
> Thanks for the reply. The second answer suits me fine. Sorry for not making the
> question clear.
> Another question:
> I built a cube using the following pseudo-code:
> for(6 faces)
> poly = GU_PrimPoly::build(gdp, 4, GU_POLY_CLOSED);
> for each vertex
> ppt = poly->getVertex(i).getPt();
> ppt = x,y,z,1; /// assign your pt position
> I will have a cube but with duplicated points (NPT = 24). In the interface if I do
> a consolidate the points I will be fine and have my 8 points. In the HDK do I have
> to do the same? Use one of the consolidatePoint functions or should I do "something"
> when I build the actual geometry?
> George ElKoura wrote:
> Hi Gerome,
> I hope I understand your question correctly. To answer a very simple part,
> there are methods in GU_Detail that will build a cube for you. Have a look
> at the methods: cube(), nurbCube(), bezCube(), etc...
> Now, I don't think that will fully answer your question. Basically, you can
> build polygons by calling GU_PrimPoly::build(). When you build a polygon,
> you will get a GEO_Vertex for each vertex of the polygon. Each GEO_Vertex
> has a pointer to a GEO_Point and the base call of GEO_Vertex, GB_Vertex has
> a method setPt() which can be used to set the point of the vertex. If two
> polygons have vertices that point to the same GEO_Point, then they are
> I hope that helps.
> Take care,
> ----- Forwarded message from Gerome Mortelecque
> <gerome.mortelecque at framestore-cfc.com> -----
> Date: Wed, 07 Jul 2004 17:04:43 +0100
> From: Gerome Mortelecque <gerome.mortelecque at framestore-cfc.com>
> Reply-To: sidefx-devkit-list at sidefx.com
> Subject: Building a cube using HDK
> To: sidefx-devkit-list at sidefx.com
> How should I proceed to build a cube having a list of points and Vertex
> I had a look at SOP_Star but I am not sure how to do the connection of
> the polygon.
> A bit of help will be wonderful
More information about the Sidefx-devkit-list