Re: Dynamic text labels for objects.....
John Rohlf (jrohlf++at++tubes)
Tue, 5 Jul 94 10:48:18 PDT
>
>
> Hi, I'm trying to use performer 1.0 to walkthrough a world, and I need all the
> entities to have dynamic words attatched to them, such as "Hello". Obviously,
> if the object isn't visible currently, I don't need the label to show up on
> top of the object. I've tried several ways to do this - but no luck. I put
> traversal callbacks for pre/post Draw, and when it gets to the object, I
> domething like:
>
> drawmode(NORMALDRAW);
>
> mapcolor(1, 255, 255, 0);
> gflush();
> color(1);
> fmsetfont(fontHandle);
> cmov(-1.0,0.0,6.0);
>
> fmprstr("Hello");
>
> but it doesn't work. I read the chapter on traversals, and I can see
> something about the draw process (this is a single process application)
> not having the transformation matrix, but I tried this code also in cull
> callbacks to no avail. What am I doing wrong,
>
There are many other GL modes which you need to manage. Try
the following:
pfPushState();
pfBasicState(); /* Turn off lighting, texturing, etc */
zfunction(ZF_ALWAYS);
> drawmode(NORMALDRAW);
>
> mapcolor(1, 255, 255, 0);
> gflush();
> color(1);
> fmsetfont(fontHandle);
> cmov(-1.0,0.0,6.0);
>
> fmprstr("Hello");
zfunction(ZF_LEQUAL);
pfPopState();
This archive was generated by hypermail 2.0b2
on Mon Aug 10 1998 - 17:50:23 PDT