Cube Vertex Normals

Started by
15 comments, last by Todd Casey 23 years, 9 months ago
When rendering a cube using vertex indices for an 8 vertex cube what is the proper way to compute the vertex normals? Should the normals be pointing away from the corners (out and away at a 45 degree anble from one of the edges). I guess to do that you would take the average of the 3 vertices that connect to that corner and that would be the normal? Thanks for any info. Todd
Advertisement
I don''t know what I was thinking earlier but I now know I should just use the actual vertex as the normal (of course normalize it). This looks correct in my tests but if I am still wrong please let me know.

Todd
Shouldnt you use just the surface normals? unless you want the faces to look curved.
Well, I am using gouraud shading which uses vertex normals for lighting calculations if I am not mistaken whereas flat shading uses face normals. I have tried it both ways and man the vertex normal vs. face normal way is no comparison. The vertex normal way looks much better with lighting and such. Please correct me if I am wrong though.

Todd
well, as far as I understand, gouraud shading is used for approximating curved surfaces. Instead of calcutating the light intensity for every pixel of the surface you just calculate it at the vertices and interpolate between them. Thats where the vertex normals come in. You use them if you want to pretend that the normal to the surface is not constant at all points on the surface. Since youre just dealing with a flat sided cube, your face normals should be the same everywhere. But if it looks cooler thats all that matters

ro

Edited by - rowbot on July 21, 2000 11:44:29 AM
Can you actually use the normalized vertex itself rather than computing the vertex normal??

I havent heard of that approach before

Todd: Just out of curiosity, what are you using to code this (DX, GL, or doing it yourself?) and what mode, 8bit, 16, 24, or 32?



ByteMe95::~ByteMe95()
ByteMe95::~ByteMe95()My S(h)ite
Hey Rob, could you try and look into my thread named "Vectors!!" and see if you can help me out with this one? I''m kinda stuck at the moment... hmm...

----------------------------------------------
That's just my 200 bucks' worth!

..-=gLaDiAtOr=-..
quote:Original post by ByteMe95

Can you actually use the normalized vertex itself rather than computing the vertex normal??



That only works with spheres that are centered on the origin.



_______________________________
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in Think Harmony With Horses
ALU - SHRDLU - WORDNET - CYC - SWALE - AM - CD - J.M. - K.S. | CAA - BCHA - AQHA - APHA - R.H. - T.D. | 395 - SPS - GORDIE - SCMA - R.M. - G.R. - V.C. - C.F.
ByteMe95:

I''m using Direct3D in 16-bit mode.

Todd
ByteMe95:
You said above: "Can you actually use the normalized vertex itself rather than computing the vertex normal??". What is the difference between the normalized vertex and computing the vertex normal. Are those not the same thing (if not what is the difference)? Would both ways not involve normalizing the vector to get the vector normal?

Todd

This topic is closed to new replies.

Advertisement