| |

VerySource

 Forgot password?
 Register
Search
View: 661|Reply: 2

Problems with control points of OpenGL bezier or nurbs surface (one hundred thousand rush)

[Copy link]

2

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-1-23 06:20:02
| Show all posts |Read mode
At present, all the surface examples in books and on the Internet only have 4x4 control points. I extended it to 8x8 control points, which can draw the surface normally. However, it cannot be displayed if it reaches 10x10 or more. Is there a limit to the number of control points? But software like 3dsmax can insert countless control points. I need a surface to build a human body model. 8x8 control points are definitely not enough. Please see the code:

/ * Control point * /
GLfloat ctrlpoints [8] [8] [3] = {

/ * Call the 2D evaluation program * /
glMap2f (GL_MAP2_VERTEX_3, 0, 1, 3, 8, 0, 1, 24, 8,&ctrlpoints [0] [0] [0]);
GlEnable (GL_MAP2_VERTEX_3);

/* evaluate */
For (j = 0; j <= 8; j ++)
{
GlBegin (GL_LINE_STRIP);
For (i = 0; i <= 30; i ++)
GlEvalCoord2f ((GLfloat) i / 30.0, (GLfloat) j / 8.0);
GlEnd ();
        }

There is no problem with the bezier surface drawn in this way, but when I change 8 to 10 or more, I can't draw it.

/ * Control point * /
GLfloat ctrlpoints [10] [10] [3] = {

/ * Call the 2D evaluation program * /
glMap2f (GL_MAP2_VERTEX_3, 0, 1, 3, 10, 0, 1, 30, 10,&ctrlpoints [0] [0] [0]);
GlEnable (GL_MAP2_VERTEX_3);

/* evaluate */
For (j = 0; j <= 8; j ++)
{
GlBegin (GL_LINE_STRIP);
For (i = 0; i <= 30; i ++)
GlEvalCoord2f ((GLfloat) i / 30.0, (GLfloat) j / 8.0);
GlEnd ();
        }

Did I confuse control points, nodes, and order? So, what if you want to draw a bezier or nurbs surface with hundreds of control points? It is best to give the source code. Many thanks!
Reply

Use magic Report

0

Threads

55

Posts

32.00

Credits

Newbie

Rank: 1

Credits
32.00

 China

Post time: 2020-2-17 09:30:01
| Show all posts
for (j = 0; j <= 10; j ++)
{
GlBegin (GL_LINE_STRIP);
For (i = 0; i <= 30; i ++)
GlEvalCoord2f ((GLfloat) i / 30.0, (GLfloat) j / 10.0);
GlEnd ();
        }
Try it.
Reply

Use magic Report

2

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-3-17 01:30:01
| Show all posts
rsq666
Not useful, glEvalCoord2f ((GLfloat) i / 30.0, (GLfloat) j / 10.0); this has nothing to do with control points, it is just a matter of how many grids to divide.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list