Billboard Bug on iR?

New Message Reply Date view Thread view Subject view Author view

inca++at++public.bta.net.cn
Fri, 31 Jan 1997 08:34:59 -0800


Hi, all iR users,

the following program makes a billboard, it rotates about viewpoint,
and i trace to view it. so i should see a still image always.
it's ok on indigo2 machine(IRIX5.3,PF2.0), but wrong on iR(IRIX6.2,
PF2.1).
is it a known bug? or am i missing something?

Thanks for any help.

(please reply befor Feb,4 or after Feb,16. i'l make holiday.)
liubin
inca++at++public.bta.net.cn

#include <stdlib.h>
#include <math.h>
#include <Performer/pf.h>

#include "/usr/share/Performer/src/pguide/libpf/C/billboard.c"

int
main (int argc, char *argv[])
{
    float r = 0.0f, t = 0.0f;
    pfScene *scene;
    pfBillboard *bill;
    pfPipe *p;
    pfPipeWindow *pw;
    pfChannel *chan;
    pfVec3 pos;
    pfCoord view;

    pfInit();
    pfMultiprocess( PFMP_DEFAULT );
    pfConfig();

    pfSetVec3(pos, 0.0f, 0.0f, 0.0f);

    bill = MakeABill(pos, NULL, 3);

    scene = pfNewScene();
    pfAddChild(scene, bill);

    pfAddChild(scene, pfNewLSource());
     
    p = pfGetPipe(0);
    pw = pfNewPWin(p);
    pfPWinName(pw, "IRIS Performer");
    pfPWinOriginSize(pw, 0, 0, 500, 500);
    pfOpenPWin(pw);
     
    chan = pfNewChan(p);
    pfChanScene(chan, scene);
    pfChanFOV(chan, 60.0f, 0.0f);

    /* position viewpoint at (0, -2, 0) */
    pfSetVec3(view.xyz, 0.0f, -2.0f, 0.0f);
    pfChanNearFar(chan, 1.0f, 100.0f);

    /* Simulate for twenty seconds. */
    while (t > -20.0f)
    {
        float x,y,z;
        static dir = 1;

        pfSync();
        pfFrame();

        t = pfGetTime();
        r += dir;
        if(r > 120.0f) dir = -1;
        if(r < -120.0f) dir = 1;
        x = 2.0f*fsin(r*M_PI/180.0f);
        y = 2.0f*fcos(r*M_PI/180.0f) - 2.0f;
        z = 0.0f;
        pfSetVec3(pos, x, y, z);
        pfBboardPos(bill, 0, pos);
        pfSetVec3(view.hpr, -r, 0.0f, 0.0f);
        pfChanView(chan, view.xyz, view.hpr);
    }

    pfExit();
}

=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
            Submissions: info-performer++at++sgi.com
        Admin. requests: info-performer-request++at++sgi.com


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:54:30 PDT

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