Large polygons and clipping

New Message Reply Date view Thread view Subject view Author view

Mattias.Johansson++at++saab.se
Thu, 22 May 1997 19:40:39 METDST


printf("Hello world!\n");

Large pfPipeWin + Large polygons = trouble?

Hi, we have a problem with clipping of polygons in Performer.
We end up with cracks appearing in our OpenFlight terrain database.

It seems that the problem is related to having a combination
of a large pfPipeWin (3840x1024) and a database with fairly large polygons.
At the moment we have three 1280x1024 channels running on one pipe.

( Anybody recognize this 'effect' .. ?)

Facts n' figures:
The Performer app is running on an Onyx IR with 3 pipes -
4 RM6 64Mb texture, Performer v 2.1 w patch 1699 & 1460.

I'm able to reproduce the effect/problem we are seeing, with a
simple Performer app, loading one of the models included in
the Performer distribution (board.sv).

It looks like this:

#include <stdlib.h>
#include <Performer/pf.h>
#include <Performer/pfutil.h>
#include <Performer/pfdu.h>

int main (int argc, char *argv[])
{
    pfScene *scene;
    pfNode *root;
    pfPipe *p;
    pfPipeWindow *pw;
    pfChannel *left;
    pfChannel *middle;
    pfChannel *right;
    pfVec3 middleHPR = {0.0, 2.5, 0.0};
    pfVec3 leftHPR = {60.0, 2.5, 0.0};
    pfVec3 rightHPR = {-60.0, 2.5, 0.0};
    pfVec3 zeroOffset = {0.0, 0.0, 0.0};
    pfDCS *dcs;
     
     
    pfCoord view;
    char *model = "/usr/share/Performer/data/board.sv";

    pfInit();
    pfMultiprocess( PFMP_DEFAULT );
    pfdInitConverter(model);

    pfConfig();

    pfFilePath("/usr/share/Performer/data/");

   
    if ((root = pfdLoadFile(model)) == NULL) {
      pfExit();
      exit(42);
    }
     
    scene = pfNewScene();
    dcs = pfNewDCS();
    pfAddChild(dcs, root);
    pfDCSScale(dcs, 10000); /* Scale up them polygons to be ... "large" */
    pfAddChild(scene, dcs);

    pfAddChild(scene, pfNewLSource());
     
    p = pfGetPipe(0);
    pw = pfNewPWin(p);
    pfPWinType(pw, PFPWIN_TYPE_X);
    pfPWinName(pw, "DBTest");
    pfPWinOriginSize(pw, 0, 0, 3840, 1024);
    pfOpenPWin(pw);
     
    /* We use 3 channels */
    left = pfNewChan(p);
    middle = pfNewChan(p);
    right = pfNewChan(p);

    pfChanAutoAspect(left, PFFRUST_CALC_NONE);
    pfChanAutoAspect(middle, PFFRUST_CALC_NONE);
    pfChanAutoAspect(right, PFFRUST_CALC_NONE);

    pfChanScene(middle, scene);
    pfChanFOV(middle, 64.0f, 56.0f);
    pfMakePerspChan(middle,
                    -pfTan(32.0),
                    -pfTan(-32.0),
                    pfTan(-28.0),
                    pfTan(28.0));
     
     
    pfChanShare(middle, PFCHAN_FOV |
                PFCHAN_VIEW |
                PFCHAN_NEARFAR | PFCHAN_SCENE);
     

    pfChanNearFar(middle, 1.0f, 100000.0f);
     
    pfChanViewport(left, 0.0, 1.0/3.0, 0.0, 1.0);
    pfChanViewport(middle, 1.0/3.0, 2.0/3.0, 0.0, 1.0);
    pfChanViewport(right, 2.0/3.0, 1.0, 0.0, 1.0);

    pfChanViewOffsets(left, zeroOffset, leftHPR);
    pfChanViewOffsets(right, zeroOffset, rightHPR);
     
    

    /* somewhere on the chessboard */
    view.xyz[PF_X] = 8000;
    view.xyz[PF_Y] = 19000;
     

    /* 2000m over the board looking down. In the middle channel there
       is a crack in the chessboard :-( */

    view.xyz[PF_Z] = 2000;
     
    view.hpr[PF_H] = 305.5;
    view.hpr[PF_P] = -90.0;
     
    view.hpr[PF_R] = 0.0;
     
    pfAttachChan(middle,left);
    pfAttachChan(middle,right);
    pfChanView(middle, view.xyz, view.hpr);

    while (42)
    {
        pfSync();
        pfFrame();
    }

    pfExit();
}

--
----------------------------------------------------------------------------
Mattias Johansson                          Email: Mattias.Johansson++at++saab.se
Systems Engineer                           Phone: +46 (0)13 - 181740
Saab Military Aircraft - Simulation Center Fax  : +46 (0)13 - 184177
581 88 Linkoping - Sweden
----------------------------------------------------------------------------

======================================================================= 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:55:17 PDT

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