Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Q: How can I reduce the time of mouse positioning?

2 views
Skip to first unread message

Sungwoo, Lim

unread,
Dec 11, 2000, 1:01:55 PM12/11/00
to
Hello,

When I trace the points of a stroke, I got usually disuncontinuous
points as below. The gap between points are wider if I draw faster.

2 > stroke-array-x
#(32 33 41 51 75 106 146 187 227 274 315 347 373 397 433 441 447 452
456 456)

I presume this is related to the time of a mouse position check...
If so, is there any way to adjust this time?
Thanks for advance.

Sungwoo

Rob Warnock

unread,
Dec 11, 2000, 10:47:10 PM12/11/00
to
Sungwoo, Lim <sun...@cad.strath.ac.uk> wrote:
+---------------
+---------------

Perhaps, but not in Lisp itself. The resolution & frequency of mouse
updates is a property of the underlying window system (X Windows, MacOS,
or MS Windows). Consult the relevant window library manuals for the system
you're using for details. For example, the X Protocol Reference Manual
says [Vol.0, p.214 (O'Reilly 1990)]:

X11 Proctocol Event: MotionNotify
...
The granularity of motion events is not guaranteed, but a client
selecting for motion events is guaranteed to get at least one
event when the pointer is moved and then comes to rest.

On some systems, you will get no more than one mouse motion events per
system scheduling clock; on others, no more than one per vertical retrace
of the display; etc., etc.

If you need finer granularity than the system provides, consider doing
your own interpolation (linear, spline [e.g., Bezier], whatever) in your
application.


-Rob

-----
Rob Warnock, 31-2-510 rp...@sgi.com
Network Engineering http://reality.sgi.com/rpw3/
Silicon Graphics, Inc. Phone: 650-933-1673
1600 Amphitheatre Pkwy. PP-ASEL-IA
Mountain View, CA 94043

Jochen Schmidt

unread,
Dec 14, 2000, 8:11:09 PM12/14/00
to
> If you need finer granularity than the system provides, consider doing
> your own interpolation (linear, spline [e.g., Bezier], whatever) in your
> application.

As I remember Bezier-curves are no splines. Bezier-curves can be described
by Casteljaus (recursive) algorithm or implemented non-recursively by using
the Bernstein-polynoms.
Splines (e. g. Birkhoff-Splines or Hermite-Splines) are concatenated e. g.
cubic polynoms that are laid through the fix-points. (Simple said)

I've some code in CL to this stuff - but they are for school-learning
purpose and therefore might be not very efficient implemented.

Regards,
Jochen

Rob Warnock

unread,
Dec 15, 2000, 4:36:48 AM12/15/00
to
Jochen Schmidt <j...@dataheaven.de> wrote:
+---------------

| > If you need finer granularity than the system provides, consider doing
| > your own interpolation (linear, spline [e.g., Bezier], whatever) in your
| > application.
|
| As I remember Bezier-curves are no splines.
+---------------

Actually, they are -- a kind of cubic spline, specifically.
[Two others are Cardinal splines & B-splines.]

Try a simple web search...

sun...@cad.strath.ac.uk

unread,
Dec 15, 2000, 7:48:56 AM12/15/00
to

> I've some code in CL to this stuff - but they are for school-learning
> purpose and therefore might be not very efficient implemented.

hmm,...
could I see the codes if possible?
Thanks alot.

Sungwoo


Sent via Deja.com
http://www.deja.com/

sun...@cad.strath.ac.uk

unread,
Dec 15, 2000, 7:47:16 AM12/15/00
to
Thanks for your help. =)

Jochen Schmidt

unread,
Dec 15, 2000, 1:21:00 PM12/15/00
to
sun...@cad.strath.ac.uk wrote:
> > I've some code in CL to this stuff - but they are for school-learning
> > purpose and therefore might be not very efficient implemented.
>
> hmm,...
> could I see the codes if possible?
> Thanks alot.

Yes sure... I'll make them available today or this weekend on my webpage

http://www.dataheaven.de

But for your Problem I would recommend you to use linear interpolation,
which means in your case simply to draw lines between the point-coordinates
you get. This should lead to a good solution IMHO and is _very_ easy to
implement

Regards,
Jochen

sun...@cad.strath.ac.uk

unread,
Dec 15, 2000, 2:31:53 PM12/15/00
to

> Yes sure... I'll make them available today or this weekend on my webpage
>
> http://www.dataheaven.de
>

Thanks. =)

> But for your Problem I would recommend you to use linear interpolation,
> which means in your case simply to draw lines between the point-coordinates
> you get. This should lead to a good solution IMHO and is _very_ easy to
> implement

Yeap, you are right. What I am doing with Lisp is kinda representation and
maintanence of vague information from a rough sketch... So, I am doing
something with free sketch strokes rather than refine them as a bezier curve,
etc.. However, it is still good for me take a look those kind of algorithms
and sample codes. =) Thanks again.

0 new messages