Jump to content
  • Advertisement

Archived

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

Todd Casey

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.

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
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

Share this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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!

..-=gLaDiAtOr=-..

Share this post


Link to post
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 this post


Link to post
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!