need pfColortable help

New Message Reply Date view Thread view Subject view Author view

Maria Gallegos (thecure++at++unm.edu)
Wed, 1 Nov 1995 17:34:10 -0700 (MST)


I'm now exploring Colortables, and really don't have a clue....

I was wondering if what i'm doing wrong, i'm trying to apply a colortable
to a cube. I'm trying to understand Colortables, and I'm trying
to start as simple as possible.
  Here is the code:

  static pfVec4 mycolor[] = { {1.0f, 0.0f, 0.0f, 1.0f},
                           {0.0f, 0.0f, 1.0f, 1.0f},
                           {1.0f, 1.0f, 1.0f, 0.5f},
                           {0.0f, 1.0f, 0.0f, 0.5f}};
  

  ctab = (pfColortable *)pfNewCtab(9, pfGetSharedArena());
  pfCtabColor(ctab,0, mycolor[0]);
  pfCtabColor(ctab,1, mycolor[2]);
  pfCtabColor(ctab,2, mycolor[3]);
   .....
   ....
   more pfCtabColor sets
   ...
  pfCtabColor(ctab, 8, mycolor[3]);

  gstate = pfNewGState(pfGetSharedArena());
  pfGStateAttr(gstate, PFSTATE_COLORTABLE, ctab);
  pfGStateMode(gstate, PFSTATE_ENCOLORTABLE, PF_ON);

  /* Wavefront format .obj */
  root = LoadFile(argv[1], gstate);

   
  Nothing appears on the screen when i do this. But if i set
  root = LoadFile(argv[1], NULL), a default color of grey appears.

  This doesn't work at all, I was wondering what i'm doing wrong?
  I've read the Programming Guide, but I need more info on Colortables.
  From what i understand, the colortable is just an array that points
  to a pfVec4??

                  R G B A
  ctab[0] ------> 1.0 0.0 0.0 1.0

Any possible input would be valuable...(and i mean any, we're
talking Major Basics here)........

thank you so much,

maria
thecure++at++unm.edu


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:52:00 PDT

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