Re: Colours versus Textures

New Message Reply Date view Thread view Subject view Author view

John Rohlf (jrohlf++at++tubes)
Tue, 24 Jan 95 11:05:40 PST


>
>
> Hi,
>
> I'd be very glad if anyone was able to explain the following misbehaviour.
>
> pfVec4 *colors;
>
> /* count is the number of triangles */
> colors = (pfVec4 *)pfMalloc(3*count*sizeof(pfVec4), arena);
>
> ... filling colors array ...
>
> pfGSetAttr(geoSet, PFGS_COLOR4, PFGS_PER_VERTEX, colors, NULL);
>
> /* works fine, the geometry appears coloured */
>
> ... elsewhere ...
>
> void **alist;
> ushort **ilist;
>
> /* next statement crashes with a segmentation violation */
> pfGetGSetAttrLists(geoSet, PFGS_COLOR4, alist, ilist);
>
> /* geoSet is sure to be a valid pointer (debugger told me), for
> all those who don't believe it: It crashed even when putting
> the statement sequence right below pfGSetAttr! */
>
> I'd like to get the base address of the color array in 'alist'.

     void *alist;
     ushort *ilist;
  
     /* next statement crashes with a segmentation violation */
     pfGetGSetAttrLists(geoSet, PFGS_COLOR4, &alist, &ilist);
  

> Because I found no way to globally override colour to white (I don't think it
> is possible, isn't it?!) I decided to first change the colour of all geometries
> to be textured to white and then set the local texture. This is a severe
> perfor-
> mance hit but it works. Now the user should be able to toggle texturing on
> and off. That means I should not completely lose the colour information. That's
> why I want to use pfGetGSetAttrLists to get the handle to the colour
> information
> in order to save it somewhere.

        Either pfColortable or pfHighlight should allow you to
override all colors to white. Try pfHighlight with PFHL_FILL mode.


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:50:53 PDT

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