Re: Motion with keyboard

New Message Reply Date view Thread view Subject view Author view

Mark McBride (mmcbride++at++cgsd.com)
Thu, 17 Oct 1996 11:53:42 -0700 (PDT)


Hi all--

   I ran into this problem trying to make a joystick control the flight...
I looked in the source for the Performer libraries. In pfiTDFXformer (I
think), there is a SetUpdateFunc function that allows you to specify the
callback for the Xformer model. Unfortunately, this is private. I made
the pfiFly member of the pfiTDFXformer public, and recompiled the
libraries. Then I could set the update the callback. The one
I substituted was mostly copied from the default update
function from pfiFly. It may be easier to
derive a class from pfiTDFXformer (if these members are protected) and
create a wrapper function that updates the callback. If anyone has a
better way I would like to hear it, as this seems like sort of a hack.

        ---Mark McBride

        mmcbride++at++cgsd.com

On Thu, 17 Oct 1996, Luc Renambot wrote:

>
> Hi,
> I have tried to modify perfly to be able to use the keyboard
> in the fly or drive mode because it's more precise than mouse
> when using big models.
> I would like something like that : + and - for increase and decrease
> the speed. Up and down arrow to go forward and backward.
> Left and riht key to turn. And some keys to go up and down.
>
> For example, I put this for the '-' key to decrease the speed :
>
> if (ViewState->xformerModel == PFITDF_FLY) {
> pfiInputXformFly *ff = pfiGetTDFXformerFly(ViewState->xformer);
> pfiIXformFlyMode(ff, PFIXFLY_MODE_ACCEL, PFIXFLY_ACCEL_DECREASE);
> }
>
> I doens't work.
>
> To change view direction, I put :
> case PFUDEV_RIGHTARROWKEY:
> if (ViewState->xformerModel == PFITDF_FLY) {
> pfiInputXformFly *ff = pfiGetTDFXformerFly(ViewState->xformer);
> pfiIXformFlyMode(ff, PFIXFLY_MODE_MOTION, PFIXFLY_MOTION_HP);
> float pos[2];
> pos[0] = 0.7; pos[1] = 0.5;
> pfiInputCoordVec(pfiGetIXformInputCoordPtr(ff), pos);
> }
> It seems not very good ... And that stops the fly and I can't move anymore
> (without the help of the mouse ;-).
>
> Someone have already done something like that before ?
> Thanks in advance.
>
> Luc.
> --
> Renambot Luc : renambot++at++irisa.fr
> Irisa - CAPS Team : http://www.irisa.fr/caps
> -------------------
> "There is a crack in everything, that's how the light gets in" L.C.
>
>
> =======================================================================
> List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.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


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:46 PDT

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