Archived

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

How do you calculate normals for a 4+ sided polygons

This topic is 5980 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

I have started coding a First Person Shooter,and am trying to implement collsion detection.The engine uses polygons rather than triangles and i need to find how to calculate surface normals for a 4+ sided polygon.I have only seen normal tutorials for triangles.COuld anyone out there help.I must not turn polys into triangles though. Cheers Simon Stone

Share this post


Link to post
Share on other sites
First of all I would say definitely DO turn polygons into triangles at some point. Design your levels and models and whatever with polygons if you''d like but at some point convert those polygons to triangles before rendering.

The problem with finding surface normals for polygons with 4+ sides is that they aren''t necessarily flat. A triangle is always flat, so it only has one surface normal. A surface that isn''t flat has a different normal at every point, so there is no single normal that is correct for the entire polygon.

If your 4+ sided polygons ARE flat, you use the same basic method as you would for triangles. Pick a corner of the polygon, and find vectors from that corner to two adjacent corners. Take the cross product of those two vectors and normalize the result.

Note to math nazis out there: I am fully aware that by definition all polygons are flat, but I''m assuming here he just means a shape defined by 4+ sides.

Share this post


Link to post
Share on other sites