• ### Popular Now

• 13
• 27
• 9
• 9
• 20

#### Archived

This topic is now archived and is closed to further replies.

# bezier surface

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

## Recommended Posts

Hello, I would like to implement normal-calculation. This is the part that does the surface-calculation:

bezierCurve4 prev=bezierCurve4(cCurves[0].nextPoint(),cCurves[1].nextPoint(),cCurves[2].nextPoint(),cCurves[3].nextPoint(),1.0f/20.0f);	//last argument is step

while(cCurves[0].hasNext()==true && cCurves[1].hasNext()==true && cCurves[2].hasNext()==true && cCurves[3].hasNext()==true) {

bezierCurve4 stepy=bezierCurve4(cCurves[0].nextPoint(),cCurves[1].nextPoint(),cCurves[2].nextPoint(),cCurves[3].nextPoint(),1.0f/20.0f);
glBegin(GL_TRIANGLE_STRIP);
while (prev.hasNext()==true && stepy.hasNext()==true) {
Point3 p=prev.nextPoint();
glVertex3f(p.x,p.y,p.z);
p=stepy.nextPoint();
glVertex3f(p.x,p.y,p.z);
}
glEnd();
prev=stepy;
prev.reset();  //starts over

}

Any ideas on implementing this? Maybe one way is to calculate two vectors on each triangle, and then calculate the crossproduct? Should I specify a normal on every vertex?