How to draw bsplines

Started by
1 comment, last by Kel19 19 years, 10 months ago
Hi all, I would like to know how to draw bsplines if I am not using NURBS. Thanks!
Advertisement
Look at

http://students.ou.edu/D/Eric.G.Diamond-1/

There''s an example app.

Scav.
you can write some evaluator code to generate surface points of your bspline surface. foreach 4x4 patch of you control points iterate your s values between [0 and 1] and your t values between [0 and 1] (the step size here will determine the tesselation of your surface). Plug these values for s&t into your bspline equation (can be found in any good 3d math book) with the proper Basis Matrix. Use the 4x4 patch as ur geometry matrix. You can get the surface normals in a similar way using the first dirivitive of the bslpine equation (with respect to S and T) and cross product. You have to do more work to convert these vertices to a quad mesh (or whatever). The thing ends up being like 4 nested loop:
 for (control points in U direction)   for (control points in V direction)     for (s [0,1], inc by s-step)       for (t [0,1], inc by t-step)           {             apointofsurface = evaluate spline at s,t with Bspline Basis and patch(u,v)              apointsnormal = cross product of results of evaluation of first dirivitive (wrt s & t)          } 


[edited by - _walrus on May 27, 2004 10:24:23 AM]

This topic is closed to new replies.

Advertisement