Drawing bezier surface

This topic is 4582 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

Hi everybody I calculated the points of a bezier surface using casteljau's algorithm Now I got a std::vector with about 10.000 points in series, so if I try to draw 'em with GL_QUADS or GL_QUAD_STRIP I obtain a messy series of lines. Is there any way of draw this points or I need to change the type of structure?

Share on other sites
you may have to use opengl evaluators and pass them the control points. How about explaining ur problem a bit more in detail

Share on other sites
Well, let's say that the surface is made like this:

p01 p02 p03 p04 p05
p06 p07 p08 p09 p10
p11 p12 p13 p14 p15
p16 p17 p18 p19 p20
p21 p22 p23 p24 p25

where p is the (x,y,z)
In my list I have the points in this order: p01 p06 p11 p21 p02 p07 p12 p17 p22 p03 p08 etc...

If I vertex those points is the mess on earth..
Because I should vertex them in this sequence to obtain a solid surface: p01 p02 p06 p07 p11 p12 p16 p17 etc...

any ideas?

Share on other sites
Quote:
 Original post by BleedWell, let's say that the surface is made like this:p01 p02 p03 p04 p05p06 p07 p08 p09 p10p11 p12 p13 p14 p15p16 p17 p18 p19 p20p21 p22 p23 p24 p25where p is the (x,y,z)In my list I have the points in this order: p01 p06 p11 p21 p02 p07 p12 p17 p22 p03 p08 etc...If I vertex those points is the mess on earth..Because I should vertex them in this sequence to obtain a solid surface: p01 p02 p06 p07 p11 p12 p16 p17 etc...any ideas?
You could do it in immediate mode (slow), or you could use indexed arrays (better), but one way or another you'll have to tell OpenGL what order to process the vertices in. For example, the index list might be something like:
1, 6, 2, 6, 7, 2, 6, 11, 7, 11, 12, 7
And so on.

Does that help at all?

Share on other sites
The surface is made by uxv points
I arranged to split the list in an array of u lists
So i vertex the surface by strips, drawing step by step list and list[u+1] points.
for(int a=0; a < points[a].size() - 1; a++){	glBegin(GL_TRIANGLE_STRIP);	list<point3D<float>*>::iterator j = points[a+1].begin();	for(list<point3D<float>*>::iterator i = points[a].begin(); i != points[a].end(); i++){		glVertex3f((*i)->GetX(), (*i)->GetY(), (*i)->GetZ());		glVertex3f((*j)->GetX(), (*j)->GetY(), (*j)->GetZ());		j++;	}	glEnd();}

Thanks anyway

1. 1
2. 2
3. 3
Rutin
22
4. 4
frob
16
5. 5

• 9
• 33
• 13
• 12
• 10
• Forum Statistics

• Total Topics
632579
• Total Posts
3007178

×