Field of view computation by pfChannel

New Message Reply Date view Thread view Subject view Author view

Scott Herod (herod++at++evt.com)
Tue, 03 Nov 1998 16:51:08 -0700


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


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Tue Nov 03 1998 - 15:51:13 PST

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