Jump to content
• Advertisement

#### Archived

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

# bezier surface

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

If you intended to correct an error in the post then please contact us.

## 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?

#### Share this post

##### Share on other sites
Advertisement

• Advertisement
• Advertisement

• ### Popular Contributors

1. 1
2. 2
3. 3
4. 4
Rutin
13
5. 5
• Advertisement

• 26
• 10
• 9
• 9
• 11
• ### Forum Statistics

• Total Topics
633696
• Total Posts
3013394
×

## Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!