Still problems with mouse

New Message Reply Date view Thread view Subject view Author view

abrend++at++idt.unit.no
Fri, 17 Mar 1995 11:49:34 +0100


> You should put this call in the app process, unless the function moveWithMouse
> has some draw-specific calls within it. This way, it takes just that much more
> load off the draw process. The call to pfuGetMouse should be done in the
> draw callback.

OK, but it still not function properly. What I do is :

In preFrame(): (Between pfSync() and pfFrame())

   /* Moves viewpoint accordingly to the mousecoordinates */
   if ((pfuMapMouseToChan(&viewState->mouse, viewState->masterChan)&&
        (viewState->mouseMove)))
      moveWithMouse();

In moveWithMouse():

   viewState->hDirection -= (viewState->mouse.xchan);
   viewState->corrY = cos((viewState->hDirection/180)*3.14159);
   viewState->corrX = tan((viewState->hDirection/180)*3.14159);
   if (viewState->hDirection > 360.0f)
      viewState->hDirection = 0.0f;
   else if (viewState->hDirection < -360.0f)
      viewState->hDirection = 0.0f;
    
   viewState->yDirection += (viewState->mouse.ychan)*viewState->corrY;
   viewState->xDirection -= (viewState->mouse.ychan)*viewState->corrY*viewState->corrX;

And I put the pfGetMouse() in the postDraw() like this:

void
PostDraw(pfChannel *chan, void *data)
{
   data; /* suppress compiler warns */
    
   /*
    * Read GL keyboard, mouse. Make sure we only collect input on
    * master channel. If hyperpiping we must collect on all pipes.
    */

   pfuGetMouse(&viewState->mouse);
    
   /* Queue devices */
   pfuCollectInput();
    
   while (qtest())
   {
      prosessKeys();
   }
    
}

Any ideas why this don't function. It looks like the mouse structure
isn't set right!

If anyone will give me some hints how to build my app. with best
performance, you're free to give me a simple list how proceed.

regards

        /*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*
        /* WWW page : http://www.idt.unit.no:80/~abrend/ *
        /*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*

email___________________________________________________
|
                                                        V
        _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
       _/ Andreas Brendstuen _/ abrend++at++stud.unit.no _/
      _/ Festningsgata 11 _/ abrend++at++idt.unit.no _/
     _/ 7014 Trondheim, Norway _/ +47 61 29 44 34 _/
    _/ +47 73 51 48 06 _/ (when visiting hometown) _/
   _/ (don't call at saturday mornings) _/ _/
   _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/


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:51:05 PDT

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