-
Calculating Normal vectors
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 will be appreciated.
chuks
-
Re: Calculating Normal vectors
you have 3 vertices with a x, y and z coordinate. this vertices are 3-dimensional vectors. Use the Crossproduct and you'll get a normal vec
(v3-v1)x(v2-v1)
-
Re: Calculating Normal vectors
Hi !
Have a look at:
http://www.ime.usp.br/~massaro/openg.../redbook-E.pdf
and
http://www.lp23.com/files/tutorial_03.pdf
(I found them both at google)
Mikael
[This message has been edited by mikael_aronsson (edited 08-05-2003).]
-
Re: Calculating Normal vectors
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules