PDA

View Full Version : Scaling mouse movements



06-28-2002, 06:14 AM
I am programming a vector drawing program, using interactive drawing with a mouse. It works really well until I try to scale the drawing. Then the mouse cooridinates are not using the same scale as the existing drawing.

So I nned to scale the mouse movement based on the scale of the drawing.

Is there an easy way to do this ?

cheers,
Jim Parker

rael II
06-28-2002, 07:44 AM
i'm assuming by nn'd you ment mm'd... OpenGL doesn't provide anything more than a low level graphics api, you're pretty much on your own to find a solution to any input related problems. In the same situation I personally would manually transform the mouse as well...

nexusone
06-28-2002, 08:51 AM
I think your own the right track, there is not eacy way to do it.

You have to scale the mouse movement based on the screen scale.



Originally posted by Jim Parker:
I am programming a vector drawing program, using interactive drawing with a mouse. It works really well until I try to scale the drawing. Then the mouse cooridinates are not using the same scale as the existing drawing.

So I nned to scale the mouse movement based on the scale of the drawing.

Is there an easy way to do this ?

cheers,
Jim Parker

Gavin
07-01-2002, 06:05 AM
I tried this some time ago for dragging/picking objects on the screen. But failed to get it to map exactly and couldn;t stop the points/mouse from drifting apart.