I have a problem… hopefully someone here (as always can help me out…
Here’s what I would like to do:
have the user click on screen and generate b-spline profile, then drag the mouse and have that curve revolve and produce a swept/revolved surface, then have the program output a list of points to a file, so that a file could be read back and the surface could be regenerated (using GL_POLYGON or GL_TRIANGLES). I can not use any external libraries, only the standard ones in ogl. I know that I will have to use unproject function to get 3de coordinates and I know that I will need to generate a new curve each time, as ogl doens’t let for interactive editing (i.e. the curve could not be previsualized as the user clicks, creating more points…). Here’s what I can’t figure out:
- what parameters do I have to pass to nurbs object or curve (the ones build into ogl), to make it behave like b-spline curve or surface?
- Most important one: how can I pass the control points to nurbs object and somehow get a list of points or triangles that the nurbs evaluation function came up with. For instance. Input: control points. u,v step 0.05. Query: all the points (or triangles) that got evaluated, so that I could save those points in a file and then read them and display the object, but this time as GL_POLYGONS or GL_TRIANGLES ? Is this possible or do I have to write my own b-spline functions ?
- finally, using just the nurbs surfaces that come in ogl… how could I create a surface that sweeps as the user moves the mouse? For instance… a wine glass profile curve is generated (using the nurbs curve (will actually have to be b-spline)) then as the curve is completed, the user drags the mouse, and the surface is swept from 0-360 degrees. Can this be accomplished with ogl nurbs? I guess what I’m asking here is ‘how’ ?
Should I add control points as the surface is swept, or can one specify a drawing range for nurbs surface. For instance, I could pass it all the control vertices and just say, draw u from 0-0.25 and draw v from 0-0.25 (to draw just 1/4 (or 1/8)of the surface?
sorry about the lenght of this post and thank you soo much for your help guys.
Luke