R: [Plib-users] navigation using mouse
                
                Brought to you by:
                
                    sjbaker
                    
                
            
            
        
        
        
    | 
     
      
      
      From: Paolo L. <p.l...@ci...> - 2003-04-24 12:19:15
      
     
   | 
Andreia R. Assuncao Schneider wrote: > > I'm trying to do a program that uses the mouse for navigation. I'm using > GlUT to build the frame. > Has anyone done it already? Andreia, please find attached the file with the excerpt of the code I use for the mouse navigation model in my Plib-based viewer. The three mouse buttons are mapped to camera motion in the following way: - Left: walk navigation on the x-y plane - click set the init, moving the mouse while keeping left-button pressed give proportional delta for direction and speed; - Middle: look around - click set the init, moving the mouse while keeping middle-button pressed give proportional delta for yaw and pitch angles - they remains for further walk navigation; - Right: move on the vertical plane perpendicular to the walk direction - click set the init, moving the mouse while keeping right-button pressed give proportional delta for vertical and lateral movements. These seems to me quite natural as camera manipulations in a walk approach - not suitable for examining an object though. Some simplification from the original code could need to adapt the constant used as mapping factor between pixels and world space. The code should even compile (not tried), yet please feel free to ask anything about it. Greetings - Paolo ------------------------------------------------------------------------- Paolo Leoncini phone: +39 (0823) 623134 Visualization & Virtual Reality fax: +39 (0823) 623126 CIRA - Italian Center for Aerospace Researches mailto:p.l...@ci... Via Maiorise - 81043 Capua (CE) Italy http://www.cira.it  |