Re: pfuClipCenterNode

New Message Reply Date view Thread view Subject view Author view

From: Paolo Farinelli (paolo++at++sgi.com)
Date: 10/12/2001 16:37:11


Hi Larry,

You can have a look at the cliptexture loader source:
/usr/share/Performer/src/lib/libpfdb/libpfct/pfct.C.
This uses pfuClipCenterNode.

You may also look at the pfuClipCenterNode code itself:
/usr/share/Performer/src/lib/libpfutil/pfuCenterNode.C

Also, the source for pfuProcessClipCenters and
pfuProcessClipCentersWithChannel
is in /usr/share/Performer/src/lib/libpfutil/clipcenter.c

The errors you are getting suggest that your application code does not
'attach' the cliptexture
to the pipe through pfuAddMPClipTextureToPipes.
(code for this is also available,
/usr/share/Performer/src/lib/libpfutil/cliptexture.c)

For a simple example, try adding the following lines to simple.c
(/usr/share/Performer/src/pguide/libpf/C/simple.c):
just before the main while loop.

{
    pfList* mpcliptex = pfNewList( sizeof(void*), 1,
pfGetSharedArena());
    PFASSERTALWAYS(mpcliptex);
    pfuProcessClipCentersWithChannel(root, mpcliptex, chan);
    pfNotify( PFNFY_ALWAYS, PFNFY_PRINT, "Found %d cliptextures",
pfGetNum(mpcliptex));
    pfuAddMPClipTexturesToPipes(mpcliptex, p, NULL);
    pfDelete(mpcliptex);
}

Also, make sure you call pfuInit(), just after pfInit will do fine.

Then run ./simple yourcliptex.ct

Hope this helps,
Paolo

Larry Ramey wrote:

> Hello,
>
> The man page (both online and on my machine) for pfuClipCenterNode
> seems to be broken. It promises an example code fragment, but there is
> no code to be found. Nor does it describe the functions, it has
> documentation for pfuTexGenClipCenterNode. (whatever that is)
>
>
> Does anyone have a simple code fragment of how to use a
> ClipCenterNode. I have successfully rendered the ClipTexture in my
> environment using:
>
> while(true){
> pfSync();
> pfFrame();
>
> CAVEGetPosition(CAVE_HEAD_NAV,position);
> for(int i=0;i<3;++i){
> if(position[i] < 0) position[i]=0;
> if(position[i] > POLYSIZE ) position[i] = POLYSIZE;
> }
>
> Shared->mpClip->setCenter(position[0]*Shared->width/POLYSIZE,
>
> position[1]*Shared->hieght/POLYSIZE,
>
> position[2]*Shared->depth/POLYSIZE);
>
>
> }
>
>
> I'd like to switch over to ClipCenterNodes if I can.....
> but I get this LONG list of errors:
>
> PF Warning/Usage(2): No hardware support for VSYNC, frame
> sync may vary.Assuming 60Hz.
> PF Warning/Usage(22): pfUpdatable::copy() - (null) is not a
> pfUpdatable
> PF Warning/Usage: pfuTraverse() Unknown node type 0x0 -
> (null)
> PF Warning/Usage: pfuClipCenterNode post-app callback
> called,
> PF but clip texture not defined or not
> attached to a pipe.
> PF Use pfuProcessClipCenters() and
> pfuAddMPClipTexturesToPipes().
>
> and then it repeats.
>
> I'm sure I'm doing something simple wrong, anyone have examples of
> working ClipCenterNodes?
>
>
>
> --
> "And I won't waste my time fitting in/
> Because I don't think contrast is sin" -MillenColen
> Larry E. Ramey
> Software Engineer
> ramey++at++vrco.com
>
>

--
Paolo Farinelli                                           paolo++at++sgi.com
Member of Technical Staff, OpenGL Performer              1-650-933-1808
Silicon Graphics        1600 Amphitheatre Pkwy, Mountain View, CA 94043


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Fri Oct 12 2001 - 16:37:14 PDT

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