John Rohlf (jrohlf++at++tubes)
Mon, 9 Jan 95 11:30:54 PST
For lighting, make sure your geoset has normals, and
you've set up a pfLight, a pfLightModel, and you
have enabled lighting with pfEnable(PFEN_LIGHTING).
> 2) I created master objects using i3dm and save the objects as sv format.
> When I use the sv loader, the objects are shaded correctly, but I
> cannot get access to their geometry. In order to make each cloned
> oject with its own geometry, I don't use pfClone, because, as I
> understand it, pfClone doesn't copy the object geometry. Therefore
> I use pfCopy for the objects pfGeoSet, pfGeoState, and pfMaterial.
> Once, the object has been completely copied, I querey the geometry
> list with:
>
> pfGetGSetAttrLists(gset, PFGS_COORDS3, (void**)poly_list, (ushort** i));
>
> The contents of poly_list is all zeros, not the geometry, yet when I
> querey the number of vertices and triangles in the pfGeoSet, the
> correct values get returned, I just a cannot get the old geomtry.
pfCopy copies geoset arrays by reference rather than by value.
I don't know why your list is all zeros but you'll need to
clone the arrays yourself:
newCoords = pfMalloc(pfGetMallocSize(poly_list),
pfGetMallocArena(poly_list));
pfCopy(newCoords, poly_list);
pfGSetAttr(cloneGSet, PFGS_COORD3, PFGS_PER_VERTEX,
newCoords, NULL);
Hopefully in the next release pfClone will handle geometry.
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:50:51 PDT