From: Sungwoo, Lim
Subject: Q: How can I reduce the time of mouse positioning?
Date: 
Message-ID: <111220001801559735%sungwoo@cad.strath.ac.uk>
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

From: Rob Warnock
Subject: Re: Q: How can I reduce the time of mouse positioning?
Date: 
Message-ID: <91473u$9n2d9$1@fido.engr.sgi.com>
Sungwoo, Lim <·······@cad.strath.ac.uk> wrote:
+---------------
| 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?
+---------------

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		····@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
From: Jochen Schmidt
Subject: Re: Q: How can I reduce the time of mouse positioning?
Date: 
Message-ID: <91bqrl$3l7cd$1@ID-22205.news.dfncis.de>
> 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
From: Rob Warnock
Subject: Re: Q: How can I reduce the time of mouse positioning?
Date: 
Message-ID: <91cong$b119c$1@fido.engr.sgi.com>
Jochen Schmidt  <···@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...


-Rob

-----
Rob Warnock, 31-2-510		····@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
From: ·······@cad.strath.ac.uk
Subject: Re: Q: How can I reduce the time of mouse positioning?
Date: 
Message-ID: <91d3vn$omk$1@nnrp1.deja.com>
> 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/
From: Jochen Schmidt
Subject: Re: Q: How can I reduce the time of mouse positioning?
Date: 
Message-ID: <91dn6j$3vc28$1@ID-22205.news.dfncis.de>
·······@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
From: ·······@cad.strath.ac.uk
Subject: Re: Q: How can I reduce the time of mouse positioning?
Date: 
Message-ID: <91drja$dsd$1@nnrp1.deja.com>
> 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.

Sungwoo


Sent via Deja.com
http://www.deja.com/
From: ·······@cad.strath.ac.uk
Subject: Re: Q: How can I reduce the time of mouse positioning?
Date: 
Message-ID: <91d3sj$ols$1@nnrp1.deja.com>
Thanks for your help. =)

Sungwoo


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