[comp.sys.apple2] B-splines

ericmcg@pnet91.cts.com (Eric Mcgillicuddy) (06/06/91)

Mega question:

What are Bsplines and how can they be drawn using Quickdraw II?

I have seen this term is a number of places and am very curious about it. 
I would appreciate any code fragments that can demonstrate them on a GS as
well (language independence, but no Assembly  :) (Unlless WELL documented :)

10q.

UUCP: bkj386!pnet91!ericmcg
INET: ericmcg@pnet91.cts.com

toddpw@nntp-server.caltech.edu (Todd P. Whitesel) (06/06/91)

ericmcg@pnet91.cts.com (Eric Mcgillicuddy) writes:

>What are Bsplines and how can they be drawn using Quickdraw II?

Bsplines are curves that are formed by parametric interpolation of a list
of "control points" -- if you have a list of points, and connect them in
order, you'll get a jaggy 'curve' with sharp corners and so on; draw the
set of Bspline segments specified by that same list of points and you'll
get a smooth curve shaped roughly like the jaggy one, as if the jaggy
curve had all its corners severely smoothed out.

No existing implementation of Quickdraw is capable of drawing Bsplines as
objects. The TrueType font engine might be able to do it, they are using
curves that should be a superset of cubic Bsplines (which is what most
people simply refer to as Bsplines).

I do have code examples but they would take a while to explain (they use
matrix operations to represent and evaluate the curve points), and I'm not
sure if I have a stable executable with the curve code in it that you can
run on a stock GS.

Todd Whitesel
toddpw @ tybalt.caltech.edu

P.S. do it quick, I leave in a little over a week.

meekins@anaconda.cis.ohio-state.edu (Tim Meekins) (06/06/91)

In article <819@generic.UUCP> ericmcg@pnet91.cts.com (Eric Mcgillicuddy) writes:
>Mega question:
>
>What are Bsplines and how can they be drawn using Quickdraw II?


B-splines are a special interpolating function which allows drawing smooth
curves. They can be drawn by QD II to extent that anything can be drawn by 
QD II by using _MoveTo and _LineTo. Basically, input to the spline function
is a set of control points. As the line is drawn, the line tends to head 
towards these pointes, but not necessarily pass through them.

>
>I have seen this term is a number of places and am very curious about it. 
>I would appreciate any code fragments that can demonstrate them on a GS as
>well (language independence, but no Assembly  :) (Unlless WELL documented :)
>


Maybe I can throw something together over the weekend. Don't get over excited
though, it is not going to be very speedy. It will be sort of like 3-D graphics
on the GS. There are ways of doing it quickly, but not easily.

--
++------------S-U-P-P-O-R-T---S-H-A-R-E-W-A-R-E---O-R---D-I-E-!-----------++
|| Tim Meekins                   ||  Snail Mail:           ||   Apple II  || 
||   meekins@cis.ohio-state.edu  ||    8372 Morris Rd.     ||   Forever!  ||
\\___timm@pro-tcc.cts.com________/\____Hilliard, OH 43026__/\_____________//

benson@vuse.vanderbilt.edu (Paul Benson) (06/07/91)

In article <819@generic.UUCP> ericmcg@pnet91.cts.com (Eric Mcgillicuddy) writes:
>Mega question:
>
>What are Bsplines and how can they be drawn using Quickdraw II?

  Get THE necessary book, _Numerical Recipes in C: The Art of Scientific
  Computing_ by William H. Press, Brian P. Flattery, et al. Cambridge Press.
  Also available for FORTRAN and Pascal.  Their C implementations are
  somewhat backward, but the code works along with a good description of
  what you are doing and why.

  Paul Benson
  Vanderbilt University
  GEnie: p.benson1

scottg@gnh-starport.cts.com (Scott Gentry) (06/11/91)

For a good example of BSplines and other graphics code in Pascal, you can 
check out a book titled "Computer Graphics Software Construction" by Rankin
from Prentice Hall; ISBN 0-13-162793.  The code in this text is easy to 
understand and best of all requires minimal effort to port to a GS (drawing
code primarily).  A long time ago when I was playing with splines and Bezier
curves, I sent the code to some people.  I may still have it on my GS at home
but it's really quite trivial to port the code from the book mentioned above.
Granted, it's not going to set speed records, but it can show everyone what
needs to be done.
_______________________________________________________________________________
| Scott Gentry                * ALPE   AFL Scott         *  I never said that!|
| 2051 Mercator Drive         * GEnie  W.GENTRY          *     But you never  |
| Reston, VA 22091            * UUCP: uunet!ingr!ne1300! *         know!      |
| (703) 264-5652              *       brnded!scott       *        Do You?     |
|_____________________________________________________________________________|

stephens@latcs1.lat.oz.au (Philip J Stephens) (06/12/91)

Scott Gentry writes:

>For a good example of BSplines and other graphics code in Pascal, you can 
>check out a book titled "Computer Graphics Software Construction" by Rankin
>from Prentice Hall; ISBN 0-13-162793.

  Ha!  John Rankin just so happens to be the supervisor for my honours
thesis in computer animation!  I'm sure he'll get a kick out of
hearing about this one. <grin>

<\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/><\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\>
<  Philip J. Stephens                ><   "Many views yield the truth."       >
<  Hons. student, Computer Science   ><   "Therefore, be not alone."          >
<  La Trobe University, Melbourne    ><   - Prime Song of the viggies, from   >
<  AUSTRALIA                         ><   THE ENGIMA SCORE by Sheri S Tepper  >
</\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\></\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/>

samkho@athena.mit.edu (Samuel P Kho) (06/12/91)

This message is empty.