My NURBS Surface Viewer using GLUT and GLUI

Ohhh no!!! its 2 pm already… and i still stuck with this genetic algorithm stuff. However, here my NURBS viewer. Since the gluNurbsSurface has failed when dealing with large number of knots/control points (its took a long time to render), so i decided to build my own Nurbs Surface viewer.

NURBS surface

NURBS surface

A ship hull

A ship hull

And here partial of the configuration file:

! Conventional Skinning Surface
! Num of Points on v direction
17
! Num of Points on u direction
38
! Num of Knots on v direction
21
! Num of Knots on u direction
42
! Num of ?? on v direction
4
! Num of ?? on u direction
40
! Order on v direction
4
! Order on u direction
4
! Knot on V direction
0 0 0 0 0.125 0.1875 0.25 0.3125 0.375 0.4375 0.5 0.5625 0.625 0.6875 0.75 0.8125 0.875 1 1 1 1

! Knot on U direction
0 0 0 0 0.3204168 0.3330365 0.3386205 0.3615613 0.3640918 0.3996359 0.4230176 0.4400723 0.4703173 0.4771228 0.4806252 0.4995547 0.5038797 0.5067325 0.5071404 0.5266452 0.5291815 0.533802 0.5355079 0.5368688 0.5375204 0.54007 0.5779993 0.5956679 0.6181809 0.6400152 0.6523381 0.6688393 0.6768478 0.6881943 0.6948065 0.6951187 0.6983484 0.6992325 1 1 1 1

! Cross Section Control Points (U) : 0
0.0000000 0.0000000 0.0000000 1.0
0.6666667 0.0000000 0.0000000 1.0
1.6666667 0.0000000 0.0000000 1.0
3.0000000 0.0000000 0.0000000 1.0
4.0000000 0.0000000 0.0000000 1.0
5.0000000 0.0000000 0.0000000 1.0
6.0000000 0.0000000 0.0000000 1.0
7.0000000 0.0000000 0.0000000 1.0
8.0000000 0.0000000 0.0000000 1.0
9.0000000 0.0000000 0.0000000 1.0
10.0000000 0.0000000 0.0000000 1.0
11.0000000 0.0000000 0.0000000 1.0
12.0000000 0.0000000 0.0000000 1.0
13.0000000 0.0000000 0.0000000 1.0
14.3333333 0.0000000 0.0000000 1.0
15.3333333 0.0000000 0.0000000 1.0
16.0000000 0.0000000 0.0000000 1.0

! Cross Section Control Points (U) : 1
0.0000000 0.0000000 0.1183558 1.0
0.6669870 0.0204567 0.1144623 1.0
1.6668257 0.0823568 0.1066065 1.0
3.0001828 0.1567253 0.0830420 1.0
4.0009233 0.2080720 0.0705577 1.0
4.9990463 0.3250287 0.0400466 1.0
5.9999298 0.3737906 0.0322105 1.0
6.9998674 0.4348038 0.0182866 1.0
7.9994083 0.5059588 0.0020279 1.0
8.9999562 0.5055757 0.0006495 1.0
10.0002874 0.5222002 -0.0016813 1.0
11.0009609 0.4849985 0.0049546 1.0
12.0012907 0.4111537 0.0210627 1.0
12.9993008 0.2804071 0.0513682 1.0
14.3343042 0.1803885 0.0684193 1.0
15.3320223 0.0418953 0.1172258 1.0
16.0000000 0.0000000 0.1137902 1.0

...

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s