🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Vertex Normals

Started by
3 comments, last by Pellebert 24 years, 6 months ago
Can someone plase help me calculating vertex normals. I´ve tried a lot of different ways, but i can´t get it quit right. Face normals is no problem. So,can someone help me??
Advertisement
cant''t you just add the normals of the faces that contact with that vertex and normalize the result? (hey, I''m more that a newbie here, so just ignore the post if it''s terribly wrong)
Sure, but then i´ll be doing two almost equal calculations. And because i´m using a morphing object, it will be a lot of calculations just for the normals. So i was hoping that i could calculate them another way...
Like alexmoura said, you have to calculate the normals of the faces that use the vertex and come up with an average.

A vertex in itself doesnt have a normal. There are an infinite number of lines and planes that are tangent/normal to one point.

You don't need to calculate at run-time though. That's how you keep the speed. They'll calculate the normal in the editing/design stage find the closest and just say, "use this normal here", save that with the vertex data, and never calculate it again.

Alot of engines cheat on this the same way they do for sin and cosine. They make up an array of something like 180 'official' normals. Then they calculate, find the closest and just say "use normal 18". It's accurate enough for most things and you only need a BYTE instead of four DWORDS for each normal


Edited by - logistix on 1/8/00 4:23:26 PM
-the logistical one-http://members.bellatlantic.net/~olsongt
If your code is set up nicely, you should be able to change the vertex type to one that includes vertex normals, and then precaluclate them the way the others said.

This topic is closed to new replies.

Advertisement