chuks

08-05-2003, 09:09 AM

Hi,

part of my project involves using opengl. I will like to know how to calculate normal vectors (for glNormal3f) for a large set of scanned object. assumming the data is something like this.....

glBegin(GL_TRIANGLES);

glNormal3f ();

glVertex3f(7.4350,-2.47203, -45.1869);

glVertex3f(71.6133, 6.12588, -53.2960);

glVertex3f( 50.12, 10.45, 23.00);

glNormal3f ();

glVertex3f(74.4350, -2.47203, -45.1869);

glVertex3f( 77.6763, -2.29052,-38.1057);

glVertex3f( 82.0971, -7.86762, -36.3902);

glNormal3f ();

glVertex3f( 74.4350, -2.47203, -45.1869);

glVertex3f( 71.6133, 6.12588, -53.2960);

glVertex3f( 67.6907, -1.83262, -61.1861);

glNormal3f ();

glVertex3f( 74.4350, -2.47203, -45.1869);

........etc

any contribution/reference will be appreciated.

chuks

part of my project involves using opengl. I will like to know how to calculate normal vectors (for glNormal3f) for a large set of scanned object. assumming the data is something like this.....

glBegin(GL_TRIANGLES);

glNormal3f ();

glVertex3f(7.4350,-2.47203, -45.1869);

glVertex3f(71.6133, 6.12588, -53.2960);

glVertex3f( 50.12, 10.45, 23.00);

glNormal3f ();

glVertex3f(74.4350, -2.47203, -45.1869);

glVertex3f( 77.6763, -2.29052,-38.1057);

glVertex3f( 82.0971, -7.86762, -36.3902);

glNormal3f ();

glVertex3f( 74.4350, -2.47203, -45.1869);

glVertex3f( 71.6133, 6.12588, -53.2960);

glVertex3f( 67.6907, -1.83262, -61.1861);

glNormal3f ();

glVertex3f( 74.4350, -2.47203, -45.1869);

........etc

any contribution/reference will be appreciated.

chuks