[PyOpenGL-Users] a question about nurbs and the glu routines.
Brought to you by:
mcfletch
From: noah l. <nl...@ea...> - 2002-01-28 21:56:50
|
Hi everyone,=20 disclaimer: I'm just learning both python and opengl, and I may be breaking off more than I can chew here. Python 2.2 windows 2000 sp2 pyopengl 2.0.0.44 I'm using python and opengl to do more abstract, creative interactive environments in the hopes of integrating these studies into my chosen field, architecture. The program here is a single nurbs curve that is created from random points generated for each frame. I was able to modify the red book nurbs curve example with evaluators, but now I'm trying to use the glu routines (I'd like eventually to be able to do a whole bunch of these curves). two issues: the first one(and biggest) is that the thing won't work. the relevant code follows... ###nurbs4.py=20 # not sure what to put in knots... ascending floats, 7 terms # doesn't seem to make too much difference... controlpoints =3D [] # I have a basic routine to pack this =20 knots =3D [0.0, 0.0, 0.0, 1.0,2.0,3.0,4.0] =20 =20 nurb1 =3D gluNewNurbsRenderer() =20 ...<snip> def InitGL(): ...<snip> glEnable(GL_AUTO_NORMAL) glEnable(GL_NORMALIZE) gluNurbsProperty(nurb1,GLU_SAMPLING_TOLERANCE,50.0) gluNurbsProperty(nurb1,GLU_DISPLAY_MODE,GLU_OUTLINE_PATCH)=20 def DrawGlScene(): ...<snip> gluBeginCurve(nurb1) # I've tried all the kinds of types for glNurbsCurve, # with little effect. =20 glNurbsCurve(nurb1, knots, controlpoints, GL_MAP1_TRIM_2)=20 gluEndCurve(nurb1) ### end code fragment the error message I get follows: Traceback (most recent call last): File "nurbs4.py", line 85, in DrawGLScene gluBeginCurve(nurb1) OpenGL.GLU.GLUerror: [Errno 100259] can't draw pwlcurves the second problem occurred as I tried to put in an error correction callback to read GLU_NURBS_ERROR (not GLU_ERROR) and couldn't get either of them to work as a proper error. I know that GLU has deprecated the older one in favor of the new one, and I'm using the most recent version of pyopengl... In any case, if you can get me on track with the first problem, I'll be mightily appreciative. thanks in advance, noah luken |