To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.dev.macOpen lugnet.cad.dev.mac in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / Macintosh / 196
195  |  197
Subject: 
Re: mouse model manipulation
Newsgroups: 
lugnet.cad.dev.mac
Date: 
Sat, 15 Jun 2002 02:27:52 GMT
Viewed: 
2315 times
  
In lugnet.cad.dev.mac, Don Heyse writes:
Actually I'm leaning toward 180 degrees per 200 pixels.  That way you
don't have to drag the mouse a mile when running in a large window.
Maybe I'll have a look at the ldview sources.  As far I know, everyone
is happy with the mouse sensitivity in that program.

I just use the magnitude of the mouse movement, and feed it in as the first
argument to a glRotate call.  I use the delta X and delta Y as the second
and third arguments, and 0 as the final argument.  Remember that the
magnitude of the vector given by the last three arguments to glRotate is
ignored.  Only the direction that vector points matters.

One thing to note is that this produces faster rotation with smaller models.
As the frame rate slows down, the rotation rate slows down also.  I think
this is because multiple mouse events get generated during the frame, but I
only do the rotation based on the delta generated by the last one.  Maybe
some day I'll fix this.

Please note that I had to go to a lot of trouble to figure out what to apply
that glRotate to in order to have rotation work correctly.  I have a
rotation matrix that I keep around that is updated each frame.  This is
generally frowned upon, as the matrix can slowly degenerate due to floating
point round off error, but I haven't noticed any problems.

--Travis Cobbs (tcobbs@REMOVE.halibut.com)



Message is in Reply To:
  Re: mouse model manipulation
 
(...) Ok based on this and the observation that the first tiny rotation seems to be in the right direction I'm almost positive it's because the glutWarpPointer function doesn't work. I don't start warping the pointer until you've moved 10 pixels. (...) (22 years ago, 12-Jun-02, to lugnet.cad.dev.mac)

66 Messages in This Thread:

















Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR