lal7777
Posts
if all.knowledge = orange then: seed = mankind.knowledge: grow(seed,time): endif
Posts: 88
|
Post by lal7777 on Jun 7, 2011 14:53:50 GMT -5
I've been programming in basic4gl for about 2 years now, and I still don't fully understand normals. Well here's my questions: How do i define a normal for one point? (example: for a sphere made out of points to have shading would require each point to be normalized)
Why does glmodelshade(smooth) not work for per face normals?
When calculating normals what does the crossproduct() function do?
That's it, please answer. Thanks in advance.
|
|
|
Post by DJLinux on Jun 7, 2011 15:57:13 GMT -5
Vectors A,B,C ----A---- | / | / B C | / | / | / |/
vector N = crossproduct(B-A,C,A)
N --|-A---- | | / | | / B | C | / | / | / |/ In lightning the vector N becomes as normale if the lenght of the vector are exactly 1.0 Vector Normal = normalize(N) In the case of a sphere every vertex can act as N and after you made it 1.0 in length it is a perfect normal if you rotate your objects or camera or changed the light position sometimes the normals are corrupted in this case glEnable(GL_AUTO_NORMAL) can be your friend :-) Joshy
|
|
lal7777
Posts
if all.knowledge = orange then: seed = mankind.knowledge: grow(seed,time): endif
Posts: 88
|
Post by lal7777 on Jun 7, 2011 19:23:40 GMT -5
One more question, whats the difference between glnormal3f and glnormal3fv?
|
|
|
Post by matthew on Jun 8, 2011 4:11:17 GMT -5
There's a good thread here on the OpenGL forum discussing the differences between the two.
|
|
|
Post by Darkjester on Jun 9, 2011 9:56:28 GMT -5
with glNormal3FV() it takes the arguent as an array, the same is true of, glTexcoord2fv(), glVertex3fv, glVertex2fv you get the picture
|
|