#### Archived

This topic is now archived and is closed to further replies.

# Cube Vertex Normals

This topic is 6543 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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

##### Share on other sites
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

##### Share on other sites
Shouldnt you use just the surface normals? unless you want the faces to look curved.

##### Share on other sites
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

##### Share on other sites
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

##### Share on other sites
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()

##### Share on other sites
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!

##### Share on other sites
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.

##### Share on other sites
ByteMe95:

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

Todd

##### Share on other sites
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

• 11
• 19
• 12
• 34
• 9
• ### Forum Statistics

• Total Topics
631398
• Total Posts
2999838
×