! Build control points for NURBS mole hills. do u=1,4 do v=1,4
! Red.
pts1(u,v,1) = 2.0*(u-1)
pts1(u,v,2) = 2.0*(v-1) if((u==2 .or. u == 3) .and. (v == 2 .or. v == 3)) then
! Stretch up middle.
pts1(u,v,3) = 6.0 else
pts1(u,v,3) = 0.0 endif
! Green.
pts2(u,v,1) = 2.0*(u - 4)
pts2(u,v,2) = 2.0*(v - 4) if((u==2 .or. u == 3) .and. (v == 2 .or. v == 3)) then if(u == 2 .and. v == 2) then
! Pull hard on single middle square.
pts2(u,v,3) = 15.0 else
! Push down on other middle squares.
pts2(u,v,3) = -2.0 endif else
pts2(u,v,3) = 0.0 endif
! Blue.
pts3(u,v,1) = 2.0*(u - 4)
pts3(u,v,2) = 2.0*(v-1) if((u==2 .or. u == 3) .and. (v == 2 .or. v == 3)) then if(u == 2 .and. v == 3) then
! Pull up on single middple square.
pts3(u,v,3) = 11.0 else
! Pull up slightly on other middle squares.
pts3(u,v,3) = 2.0 endif else
pts3(u,v,3) = 0.0 endif
! Yellow.
pts4(u,v,1) = 2.0*(u-1)
pts4(u,v,2) = 2.0*(v - 4) if((u==2 .or. u == 3 .or. u == 4) .and. (v == 2 .or. v == 3)) then if(v == 2) then
! Push down front middle and right squares.
pts4(u,v,3) = -2.0 else
! Pull up back middle and right squares.
pts4(u,v,3) = 5.0 endif else
pts4(u,v,3) = 0.0 endif enddo enddo
! Stretch up red's far right corner.
pts1(4,4,3) = 6
! Pull down green's near left corner a little.
pts2(1,1,3) = -2
! Turn up meeting of four corners.
pts1(1,1,3) = 1
pts2(4,4,3) = 1
pts3(4,1,3) = 1
pts4(1,4,3) = 1
! gluNurbsSurface expects an array of rank 1, and C will expect
! row-major order. Reshape the pts arrays into 1D arrays in the
! opposite order
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.