gpd example files

   5118   4   2
User Avatar
Member
795 posts
Joined: April 2020
Offline
Hello all,

I am looking into writing a converter to houdini. The gpd seem to be a nice way to do that. Getting all the point into houdini worls well and is easy. I am strugeling however with adding the poygons. Hoe to build and the polygons and add connection information is a bit of a mystery to me. (gpd->buildPrimitive(GPDPRIMPOLY)

I am hoping there might be an example floating around of a program building some polygins using gpd. Does anyone know of this?

Thanks,

Koen
User Avatar
Member
8081 posts
Joined: July 2005
Offline
GPD was meant to only serve as an example for reading/writing the .geo format. It's not general enough to be used without lots of modifications. I'm afraid that you'll need to add the necessary code to it for your purposes.

You could try pooling resources with Simon (Barrick) into clobbering together a usable opensource .geo read/write library based on GPD.
User Avatar
Member
543 posts
Joined: July 2005
Offline
One way to create polys might be:


GEO_Hull *psurf;
int num_rows, num_cols = 40;
int xpts, ypts = 40;
psurf = GU_PrimMesh::build(gdp, ypts, xpts, GEO_PATCH_QUADS, 0, 0, 0);

for (int row = 0; row < num_rows; row++) {
for (int col = 0; col < num_cols; col++) {
// Append a point
ppt = gdp->appendPoint();
(*psurf)(row, col).setPt(ppt);
}
}




Mark
========================================================
You are no age between space
User Avatar
Member
2199 posts
Joined: July 2005
Offline
I'm currently sitting on a bunch of source code, but haven't gotten around to doing anything with it. I'll try and get it up on sourceForge for starters when I get some time….
The trick is finding just the right hammer for every screw
User Avatar
Member
795 posts
Joined: April 2020
Offline
Hello all,

Thanks for the example and the suggestions.

I found out how to build polygons. Once I have the points I can just add a poly primitive. The crucial step seemed to be to set the vertex pointer and size to something meaningful.Working now. (The vertices are just indices into the point array, build build passing the point to the construction of a vertex.)

Cheers,
Koen
  • Quick Links