Re: pfColortable help needed
Kowsik Guruswamy (kowsik++at++buggy.coryphaeus.com)
Fri, 30 Jun 1995 08:30:28 -0700
On Jun 29, 9:15pm, Carlo L. Tiana wrote:
> Subject: pfColortable help needed
>
> I am a little stuck (again) on how to make appropriate use of pfColortable.
> I have created a simple database using MultiGen, which consists of just 9
> cubes, in a 3 by 3 grid. Each cube is of a different unique primary color
> (full red, full green, full blue, cyan, magenta, etc.).
>
> I have minimally hacked main.c of perfly following Example #2 in the
> pfColortable man page, as follows:
> - Just before the application main loop, I call my routine 'SetupLUT()'
> - in that routine, I do the following:
> pfEnable(PFEN_COLORTABLE);
> ctab = (pfColortable *)pfNewCtab(ctabsize, pfGetSharedArena());
> (then a bunch of calls to pfCtabColor for all indices of the table)
> pfApplyCtab(ctab);
> pfOverride(PFSTATE_COLORTABLE | PFSTATE_ENCOLORTABLE, PF_ON);
>
> What appears to me to be happening is that all the pretty colors :-) of
> my colored cubes map to index 0 of the color table, so that it does not
> actually matter what I set any other index to (or for that matter how long
> my colormap is - ie the value of ctabsize above).
Actually you are not doing anything wrong. That's just the way the pfColorTable
works. I haven't tried this but it might be worth it. Why not create an indexed
geoset with color indices pointing to the pfColortable entries? Atleast that
way you are ensured that pfColortable[0] is NOT the one that's used by all the
cubes.
Another alternative is having a colortable per geoset [in the geostate!] and
then modifying the colors in each table. Ofcourse, in Performer 2.0, you could
have indexed geostates, with one colortable per geostate and let the geosets
share these.
> Where am I going wrong? I would really appreciate some help, since I have
> been beating my head against the wall for a while, and I can't find any
> hints in the docs.
>
> Thanks very much!
> Carlo.
K.
--
kowsik++at++coryphaeus.com
This archive was generated by hypermail 2.0b2
on Mon Aug 10 1998 - 17:51:37 PDT