Re: Convert raw 3D data into performer

New Message Reply Date view Thread view Subject view Author view

From: Allan Schaffer (allan++at++southpark.engr.sgi.com)
Date: 06/28/2000 10:33:25


On Jun 26, 7:47am, Mattias Roupe wrote:
> Does anyone know of any tools or code to convert a file of raw 3D data (XYZ
> coordinates separated by spaces) into Performer as triangle.
>
> The data has no grouping such as triangle stripsets/quadmeshes etc.

I don't know of any tools for this but it's (very, very, very)
easy to do in Performer. You'll need to:

  - Read the X Y Z data into an in-memory array allocated
    with pfMalloc(size, arena);

  - Put it in a pfGeoSet via:
    pfGSetAttr(gset, PFGS_COORD3, PFGS_PER_VERTEX, coordsarray, NULL);

  - Put the pfGeoSet into the scene graph (see any of the Performer
    sample programs in /usr/share/Performer/src/pguide/libpf/C that
    have pfNewGSet() in them for an example)

  - et voila'.

ps.

  - It'll look uniformly white unless you somehow specify
    colors or calculate normals as well. (You could run
    in wireframe mode to view the shape, for testing)

Allan

-- 
Allan Schaffer                                            allan++at++sgi.com
Silicon Graphics                           http://reality.sgi.com/allan


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Jun 28 2000 - 10:33:29 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.