Re: [PyOpenGL-Users] Nurbs curve Rendering?
Brought to you by:
mcfletch
From: Mike C. F. <mcf...@vr...> - 2008-10-01 12:06:56
|
Prashant Saxena wrote: > 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 Don't have time to look at the code this morning, just to point out that there's a complete nurbs-curve demo just added to the PyOpenGL-Demo project's bzr repository: http://bazaar.launchpad.net/~mcfletch/pyopengl-demo/trunk/files/2?file_id=nurbscurve-20080928050414-wwjmmaza2n95y4h9-7 which might help you. Good luck, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |