[PyOpenGL-Users] Nurbs curve Rendering?
Brought to you by:
mcfletch
From: Prashant S. <ani...@ya...> - 2008-09-30 15:28:14
|
I am trying to create a nurbs curve in 2d (no 'Z') and here is my code. The curve is not getting rendered. There is something wrong with this piece of code: Could anybody point me out? uknots= [0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0] cntrl = [[25, 50], [25, 75], [75, 75], [75, 50]] x = 10, y = 10 color = (0,0,0) """Create a GL display list to draw a Curve.""" nurb = gluNewNurbsRenderer() glNewList(101, GL_COMPILE) glPushMatrix() glLineWidth(1) glTranslate(x, y, 0) glColor(color) glEnable(GLU_MAP1_VERTEX_4) gluBeginCurve(nurb) gluNurbsCurve(nurb, uknots, cntrl, GLU_MAP1_VERTEX_4) gluEndCurve(nurb) glPopMatrix() glEndList() Prashant Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/ |