Performer 2.0 frustum problem

New Message Reply Date view Thread view Subject view Author view

Salvador Cabaruvias (sal++at++fbdev1.mdc.com)
Mon, 12 Aug 1996 11:33:33 -0700


On a Irix 5.3 Onyx (6 cpus, 2 pipes: 2RM5 per pipe) using GL and Performer 2.0
we are having problems with the frustum.

We have wide angle collimated lenses with 48 HOV and 36 VOV. One view is front,
and the second one is the left side with 2 deg overlay. Using peformer 1.2, we
had this working using the attached code sample. Now that we upgraded to
performer 2.0. The code is not working and even using Performer 2.0's perfly
to see if the hortizon matches is not working.

The problem appears that the 2 channels, the front and left have different eye
points. The left appears to be too close so that the horizon is much higher
than the front view (how close is hard to tell... not sure how to measure it).
 Both channels appear to rotate correctly.

Anyone seen this problem? Any help is appreciated.

-- 
--------------------------------------------------------------------------------
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 <pf.h> #include <pr.h> #include <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; static pfFrustum *frust = NULL;

void setChannelsd9up(void) {

setFrontChannel(topsided9_angle, bottomsided9_angle); setLeftChannel(topsided9_angle, bottomsided9_angle); } void setChannelsd3up(void) { if (frust == NULL) frust = pfNewFrust(NULL);

/* assume first channel in list is front channel */ FrontChan = global->channels->pfchan;

/* assume second channel in list is next channel */ LeftChan = global->channels->next->pfchan; pfAttachChan(FrontChan, LeftChan);

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) { printf("Defining the front window with pfMakePerspFrust\n"); /* Needed to workaround a bug */

pfFrustAspect( frust, PFFRUST_CALC_NONE, 0.0f); pfChanAutoAspect( FrontChan, PFFRUST_CALC_NONE);

pfGetChanBaseFrust(FrontChan, frust); pfFrustNearFar( frust, f_near, f_far); pfMakePerspFrust( frust, -f_near * pfTan(leftside_angle), /* left */ f_near * pfTan(rightside_angle), /* right */ -f_near * pfTan(bottomside_angle), /* bottom */ f_near * pfTan(topside_angle) /* top */ ); pfChanCullPtope(FrontChan, (pfPolytope*)frust); }

void setLeftChannel(float topside_angle, float bottomside_angle) { printf("Defining the left window with pfMakePerspFrust\n"); /* Needed to workaround a bug */ pfFrustAspect( frust , PFFRUST_CALC_NONE, 0.0f); pfChanAutoAspect( LeftChan, PFFRUST_CALC_NONE);

pfGetChanBaseFrust(LeftChan, frust); pfFrustNearFar( frust, l_near, l_far); pfMakePerspFrust( frust, -l_near * pfTan(leftside_angle), /* left */ l_near * pfTan(rightside_angle), /* right */ -l_near * pfTan(bottomside_angle), /* bottom */ l_near * pfTan(topside_angle) /* top */ ); pfChanCullPtope(LeftChan, (pfPolytope*)frust);

#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


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:53:20 PDT

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