Ren-Jye Yu (renjye++at++python.tamu.edu)
Thu, 23 Jan 1997 07:25:58 -0800
My question are :
1. Why the frame rate drop down seriously? I follow the example
in the programmer's guide. I attach my code with this mail.
2. Why the frame rate have only two values : 72Hz and 36Hz? Why
the values of frame rate between these two values will not appear?
3. I use draw callback function to draw HUD. But after that the
statistics diagram diappear. Why?
For the time being, there have only a rectangular 150x8600 with texture
applied in the enviourement. I run my program on ONYX RE2. This problem trouble
me for long time. Hope you can help me. Thanks.
-- _______________________________________________________________________________("`-''-/").___..--''"`-._ Ren-Jye Yu `6_ 6 ) `-. ( ).`-.__.`) Email :renjye++at++python.tamu.edu (_Y_.)' ._ ) `._ `. ``-..-' Phone(O) :(409) 845-0729 _..`--'_..-_/ /--'_.' ,' (H) :(409) 691-8570 (il),-'' (li),' ((!.-' Address :Aerospace Engineering Department H.R. Bright Building Texas A&M University College Station 77840-3141 _______________________________________________________________________________
void drawFunc(pfChannel *chan, void *data) { PassData *pd = (PassData*)data; pfClearChan(chan); pfDraw(); HUD(pd); }
void scenehierachy(pfScene *scene) { pfDCS *dcs; pfSCS *scs; pfLayer *layer; pfCoord location; pfMatrix dst; pfSetVec3(location.xyz, 0.0f, 0.0f, 470.0f); pfSetVec3(location.hpr, 0.0f, 0.0f, 0.0f); pfMakeCoordMat(dst, &location); dcs = pfNewDCS(); scs = pfNewSCS(dst); layer = pfNewLayer();
pfAddChild(layer, seventeenLbase()); pfAddChild(layer, seventeenLmarking()); pfAddChild(scs, layer); pfAddChild(scene, scs); }
int main (int argc, char *argv[]) { double t = 0.; pfScene *scene; pfPipe *p; pfPipeWindow *pw; pfChannel *chan[3]; pfCoord view; pfEarthSky *esky; pfVec3 hprOffsets; pfVec3 xyzOffsets; int index = 1; int j=0; int test=0; float time=0; PassData *pd; /* Initialize Performer */ pfInit();
/* Use default multiprocessing mode based on number of * processors. */ pfMultiprocess(PFMP_DEFAULT); pfFrameRate(60.0f);
/* Configure multiprocessing mode and start parallel * processes. */ pfConfig(); pfFilePath(".:/usr/poeple/renjye/Performer/Texture:~/Performer/graphic_objects");
scene = pfNewScene(); scenehierachy(scene); /*Create Earth and Sky*/ esky = pfNewESky(); pfESkyMode(esky, PFES_BUFFER_CLEAR, PFES_SKY_GRND); pfESkyAttr(esky, PFES_GRND_HT, -1.0f); pfESkyColor(esky, PFES_GRND_FAR, 0.0f, 100.0f/255.0f, 0.0f, 1.0f); pfESkyColor(esky, PFES_GRND_NEAR, 0.0f, 1.0f, 0.0f, 1.0f);
/* Config and open GL window */ p = pfGetPipe(0); pw = pfNewPWin(p); pfPWinName(pw, "View"); pfPWinOriginSize(pw, 0, 0, 1280, 1504); pfOpenPWin(pw); pfConfigPWin(pw); for(j=0;j<=2;j++) chan[j]=pfNewChan(p);
/* initializing channels for using the Multi-Channel Option */ pfuConfigMCO(chan, 3);
/* Form channel group with middle as the "master" */ pfAttachChan(chan[1], chan[0]); pfAttachChan(chan[1], chan[2]);
/* Set FOV of all channels */ pfMakeSimpleChan(chan[1], 45.0f); pfChanAutoAspect(chan[1], PFFRUST_CALC_VERT);
/* Set clipping planes of all channels */ hprOffsets[PF_P] = 0.0f; hprOffsets[PF_R] = 0.0f; pfSetVec3(xyzOffsets, 0.0f, -5500.0f, 0.0f);
/* Set up viewport and viewing offets */ /* Note that these are not shared by default */ pfChanViewport(chan[0], 0.0f, 0.5f, 0.0f, .319f); hprOffsets[PF_H] = 45.0f; pfChanViewOffsets(chan[0], xyzOffsets, hprOffsets);
pfChanViewport(chan[1], 0.0f, 1.0f, 0.39f, 1.0f); hprOffsets[PF_H] = 0.0f; pfChanViewOffsets(chan[1], xyzOffsets, hprOffsets);
pfChanViewport(chan[2], 0.5f, 1.0f, 0.0f, .319f); hprOffsets[PF_H] = -45.0f; pfChanViewOffsets(chan[2], xyzOffsets, hprOffsets); pfAddChan(pw, chan[0]); pfAddChan(pw, chan[1]); pfAddChan(pw, chan[2]); pfSetVec3(view.xyz, 0.0f, 0.0f, 471.0f); pfSetVec3(view.hpr, 0.0f, 0.0f, 0.0f); pfChanScene(chan[1], scene); pfChanNearFar(chan[1], 1.0f, 25000); pfChanFOV(chan[1], 45.0f, -1.0f); pfChanESky(chan[1], esky); pfChanView(chan[1], view.xyz, view.hpr);
make_objects(); /* Make symbology for HUD by display list */ /* Setup channel 1 passthrough data */ pd = (PassData*)pfAllocChanData(chan[1], sizeof(PassData)); /* Bind craw callback functions to channel */ pfChanTravFunc(chan[1], PFTRAV_DRAW, drawFunc); /* Initialize font */ pfuMakeRasterXFont("-*-screen-medium-r-normal--7-*-*-*-m-60-iso8859-1", &x_font1); /* Sets the current X Window font to x_font1 */ pfuSetXFont(&x_font1); pd->var = 1547; pfPassChanData(chan[1]); do{ pfFrame(); pfDrawChanStats(chan[0]); view.xyz[PF_X] = 0; view.xyz[PF_Y] = time*100; view.xyz[PF_Z] = 600.0; view.hpr[PF_H] = 0; view.hpr[PF_P] = 0.0; view.hpr[PF_R] = time/4; time +=1; pfChanView(chan[1], view.xyz, view.hpr);
}while(time<400.0);
/* Terminate parallel processes and exit. */ pfExit();
return 0; }
======================================================================= List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/ Submissions: info-performer++at++sgi.com Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:54:27 PDT