Re: Field of view computation by pfChannel

New Message Reply Date view Thread view Subject view Author view

Benedikt Kessler (bjk++at++munich.sgi.com)
Wed, 04 Nov 1998 08:49:15 +0100


Hi!

Here is just a guess:

Probably just the window (or widget) you are using for the pipewindow does
not yes exist so that performer can't get the size of the window (you
might check yourself using pfPipeWindow::getSize(int *xs, int *ys);). In
this case Performer will use the pipe's screen size and compute the aspect
according to these sizes.

I'm missing the call to pfPipeWindow::open(void);
Do you open the window in the draw process?

It looks like you should set the FOV of your channel (or call
channel->setAutoAspect(PFFRUST_CALC_HORIZ)) after the window has been
opened.

Bye! Benedikt

Scott Herod wrote:

> I'm getting a strange error with pfChannel's field of
> views. It looks like horizontal FOV are not computed if
> the PipeWindow is attached to a X window as in
>
> float fov = 45.0f;
>
> // Create and configure a window.
> pfPipe *pipe = pfGetPipe(0);
> pfPipeWindow *pipeWindow = new pfPipeWindow( pipe );
> pipeWindow->setWSWindow( display, XtWindow(_glwidget) );
> pipeWindow->setGLCxt( _glxcontext );
> pipeWindow->setWSDrawable( display, XtWindow(_glwidget) );
>
> // Create and configure a pfChannel.
> pfChannel *channel = new pfChannel( pipe );
> channel->setNearFar( 1.0f, 8000000.0f );
> channel->setFOV( 0.0f, fov );
> pfCoord view;
> view.hpr.set( 0.0f, -90.0f, 0.0f );
> float z_distance = winHeight/2 / tanf( fov * (3.1415926/180.) / 2.
> );
> view.xyz.set( 0.0f, 0.0f, z_distance );
> channel->setView( view.xyz, view.hpr );
>
> It appears that the channel is using an aspect ratio of 1.25
> regardless of the size of the window. Furthermore, this is
> a change from pf 2.0.4 where the channel could grab the window size.
> Can someone verify that aspect ratios are not changed?
>
> Thanks,
>
> Scott Herod
> scott++at++evt.com
> =======================================================================
> List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com

--
+---------------------------------+----------------------------------+
|Benedikt J. Kessler              | Silicon Graphics GmbH            |
|Training Munich                  | Am Hochacker 3 - Technopark      |
|Silicon Graphics Computer Systems| 85630 Grasbrunn-Neukeferloh, FRG |
|    ---  __o       ,__o          |                                  |
| ------_ \<,_    _-\_<,          | Phone: (+int) 89 46108-212 or -0 |
|----- (*)/ (*)  (*)/'(*)         | Fax:   (+int) 89 46107-212       |
+---------------------------------+----------------------------------+
|E-Mail: bjk++at++sgi.com                                                 |
|   Web: http://www.sgi.de/dienstleistungen/                         |
+--------------------------------------------------------------------+

New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Tue Nov 03 1998 - 23:50:29 PST

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