Salvador Cabaruvias (sal++at++fbdev1.mdc.com)
Mon, 12 Aug 1996 12:01:48 -0700
Here is the attached performer 1.2 original.
-- -------------------------------------------------------------------------------- Salvador Cabaruvias | sal++at++sgidev.mdc.com | -------------------------------------------------------------------------------- CSSL | "Well I be done seen about every McDonnell Douglas | thing when I see an elephant (310) 593-6719 | fly" --Dumbo--
/* * channels.c * %M% %I% %H% * add to the script with a line like this: * * module "setChannels" add, postinit "setChannelsup"; * * * this will override what's in the setup file */
#include <math.h> #include <Performer/pf.h> #include <Performer/pr.h> #include <Performer/prmath.h> #include "_es.h"
#define leftside_angle 24.0f #define rightside_angle 24.0f
#define topsided9_angle 24.0f #define bottomsided9_angle 12.0f
#define topsided3_angle 15.0f #define bottomsided3_angle 21.0f
void setChannelsd9up(void); void setChannelsd3up(void); void setFrontChannel(float topside_angle, float bottomside_angle); void setLeftChannel(float topside_angle, float bottomside_angle);
static float f_left = -0.5; static float f_right = 0.5; static float f_bottom = -0.5; static float f_top = 0.5; static float f_near = 2.0; static float f_far = 225000.0;
static float l_left = -0.5; static float l_right = 0.5; static float l_bottom = -0.5; static float l_top = 0.5; static float l_near = 2.0; static float l_far = 225000.0; static pfChannel *FrontChan, *LeftChan;
void setChannelsd9up(void) {
setFrontChannel(topsided9_angle, bottomsided9_angle); setLeftChannel(topsided9_angle, bottomsided9_angle); } void setChannelsd3up(void) {
setFrontChannel(topsided3_angle, bottomsided3_angle); setLeftChannel(topsided3_angle, bottomsided3_angle); #ifdef _MDCESky if(global->esky == NULL) global->esky = pfNewESky(); pfESkyMode(global->esky, PFES_BUFFER_CLEAR, PFES_SKY_GRND); pfESkyAttr(global->esky, PFES_GRND_HT, -3.0f); pfChanESky(FrontChan, global->esky); pfChanESky(LeftChan, global->esky); #endif }
void setFrontChannel(float topside_angle, float bottomside_angle) { /* assume first channel in list is front channel */ FrontChan = global->channels->pfchan; printf("Defining the front window with pfMakePerspFrust\n"); pfFrustAspect( FrontChan, PFFRUST_CALC_NONE, 0.0f); /* Needed to workaround a bug */ pfChanAutoAspect( FrontChan, PFFRUST_CALC_NONE); pfFrustNearFar( FrontChan, f_near, f_far); pfMakePerspFrust( FrontChan, -f_near * pfTan(leftside_angle), /* left */ f_near * pfTan(rightside_angle), /* right */ -f_near * pfTan(bottomside_angle), /* bottom */ f_near * pfTan(topside_angle) /* top */ ); }
void setLeftChannel(float topside_angle, float bottomside_angle) { /* pfVec3 xyz, hpr; */ /* assume second channel in list is next channel */ LeftChan = global->channels->next->pfchan; pfAttachChan(FrontChan, LeftChan);
printf("Defining the left window with pfMakePerspFrust\n"); pfFrustAspect( LeftChan, PFFRUST_CALC_NONE, 0.0f); /* Needed to workaround a bug */ pfChanAutoAspect( LeftChan, PFFRUST_CALC_NONE); pfFrustNearFar( LeftChan, l_near, l_far); pfMakePerspFrust( LeftChan, -l_near * pfTan(leftside_angle), /* left */ l_near * pfTan(rightside_angle), /* right */ -l_near * pfTan(bottomside_angle), /* bottom */ l_near * pfTan(topside_angle) /* top */ );
#ifdef MDC_OFFSET xyz[0] = 0.; xyz[1] = 0.; xyz[2] = 0.; hpr[0] = 44.; hpr[1] = 0.; hpr[2] = 0.; pfChanViewOffsets( LeftChan, xyz, hpr); #endif }
======================================================================= 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:53:20 PDT