Normals and Lesson 29
I've been racking my brain on how to do this, can anyone help?
(lesson 29 is the Bezier patch one)
Thanks
Edit:
And by normals, I mean vertex normals, not face normals.
Edited by - NitroGL on July 3, 2001 2:57:20 AM
Celeron ][ 566 @ 850256MB PC-100 CAS2 RAMDFI PA-61 Mainboard (250MB memory bandwidth sucks, it should be 500MB)ATI Radeon 32MB DDR LEWindows 98SE
I think that you can let OpenGL calclate the normals if you are using evaluators. Something like glEnable(GL_AUTO_NORMAL) check the red book.
August 26, 2003 04:49 PM
I have this problem too with lesson 29, I want to add normals to the bezier code but I don''t know where to call glnormal, and how to make a normal of a triangle, if only there are two calls to glVertex
in your initialization function add:
glEnable(GL_AUTO_NORMAL);
glEnable(GL_NORMALIZE); //optional
source: OpenGL Game Programming
glEnable(GL_AUTO_NORMAL);
glEnable(GL_NORMALIZE); //optional
source: OpenGL Game Programming
August 26, 2003 08:50 PM
can''t be made with glNormal? because later, I want to change my program to vertex array, normal arrays ...
OK retype

Check out this illustration: http://members.lycos.nl/digicoaster/cross.bmp
Made in paint, so isnt much
1: You have a tri, with the data of each vert,
2: Start with the first vert (i'll assume it is at the origin now, but u can use some basic math to calculate if not so)
Create two vector objects (write a class??) and store in them the positions of vert 2 and 3 respectively.
Now create a third(normal) vector object, and to get its value, get the cross product of 12 & 13. As long as they're not exactly the same, this works! try it.
EDIT: IMPORTANT!! IF YOU DONT NORMALIZE THE VECTORS BEFORE CALCULATING THE CROSS PRODUCT, YOUR NORMAL WILL NOT BE CORRECT!!!
Repeat the operation vor each vertex. In this way, you can use glNormal3f(normal.x, normal.y, normal.z);
Any questions? just post.
[edited by - Intamin AG on August 28, 2003 12:14:58 PM]
[edited by - Intamin AG on August 28, 2003 2:20:30 PM]

Check out this illustration: http://members.lycos.nl/digicoaster/cross.bmp
Made in paint, so isnt much

1: You have a tri, with the data of each vert,
2: Start with the first vert (i'll assume it is at the origin now, but u can use some basic math to calculate if not so)
Create two vector objects (write a class??) and store in them the positions of vert 2 and 3 respectively.
Now create a third(normal) vector object, and to get its value, get the cross product of 12 & 13. As long as they're not exactly the same, this works! try it.
EDIT: IMPORTANT!! IF YOU DONT NORMALIZE THE VECTORS BEFORE CALCULATING THE CROSS PRODUCT, YOUR NORMAL WILL NOT BE CORRECT!!!
Repeat the operation vor each vertex. In this way, you can use glNormal3f(normal.x, normal.y, normal.z);
Any questions? just post.
[edited by - Intamin AG on August 28, 2003 12:14:58 PM]
[edited by - Intamin AG on August 28, 2003 2:20:30 PM]
The world isn't unpredictable. It's CHAOTIC.
Intamin AG: You DON'T need to normalize before cross product. You can just noramalize the result. Length of input vectors only influences magnitude of result but not its direction.
[edited by - _DarkWIng_ on August 28, 2003 2:58:10 PM]
[edited by - _DarkWIng_ on August 28, 2003 2:58:10 PM]
You should never let your fears become the boundaries of your dreams.
August 28, 2003 04:11 PM
Thanks, I understand good the method now, my last question/problem: when I see the lesson29, I can''t find where is the first vertex, where the second, third .... in the data structures, last[], temp[] etc ...
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement