Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


How to draw bsplines

This topic is 5142 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, I would like to know how to draw bsplines if I am not using NURBS. Thanks!

Share this post

Link to post
Share on other sites
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]

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!