Path: utzoo!attcan!uunet!ogicse!plains!bakke From: bakke@plains.UUCP (Jeffrey P. Bakke) Newsgroups: comp.graphics Subject: B-Splines Message-ID: <3834@plains.UUCP> Date: 21 Mar 90 18:11:58 GMT Reply-To: bakke@plains.UUCP (Jeffrey P. Bakke) Organization: North Dakota State University, Fargo Lines: 30 I have a project that I am currently working on that requires me to create a polygon manipulation package for 2-D graphics. Up to this point everything has been great. Its up and running but I'd like to improve the code somewhat. This is the problem, I have a function called polygon_BSpline, that when sent the polygon structure, will plot a BSpline curve using 4 control points. My problem is, is that this function, out of the whole 10,000 line program is the only function that requires floating point. I was wondering of those of you in netland would have either a code segment, generalized algorithm or good references for implementing a BSpline function via integers. If I could get rid of the floating point, i can dump the 20K FP Emulation library that Turbo C lags onto my program. I attempted to convert the current Spline function that I had using long integers and shifting the floating point into the integers. Unfortunately my implementation will overflow the long integers if I set a shift greater than 8 bits (256 * the Floating point number). And of course, if I do use 8 bit shift into the integers, I lose so much precision that my spline becomes hash anyway... Anyway, any pointers as to references, algorithms or code would be greatly appreciated... Jeff Bakke bakke@plains.NoDak.edu Oh, and i do read this group so feel free to post for others....