Jump to content
  • Advertisement

Archived

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

amish1234

area of a triangle in 3d space

This topic is 5499 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 need to calculate the surface area of triangles in 3d space. For a triangle in 2D space it''s just length*height/2. I suppose I could rotate the triangle so that it lies in an axis-aligned plane, and then do length*height/2, but I was wondering if there is just some formula I can use. It would be interesting to see if I can use the plane equation for the plane the triangle lies in to somehow compensate for it not being in an axis-aligned plane. Proceeding on a brutal rampage is the obvious choice.

Share this post


Link to post
Share on other sites
Advertisement
you can get the length of the 3 edges of the triangles using pythagoras'' theorem, and from that i''m pretty sure you can calculate the area... yeh?

Share this post


Link to post
Share on other sites
the surface area can be found while calculating the normal. The length of the normal is the area of the triangle

Vector E(V1 - V0);
Vector F(V2 - V1);
Vector N = E.Cross(F);

float area = N.GetLength();

Share this post


Link to post
Share on other sites
quote:
Original post by oliii
the surface area can be found while calculating the normal. The length of the normal is the area of the triangle

Vector E(V1 - V0);
Vector F(V2 - V1);
Vector N = E.Cross(F);

float area = N.GetLength();



Actually, as Eelco said, it is half this area.

(outer product = cross product)

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.

Share this post


Link to post
Share on other sites
soz, my mistake, 1/2 the length. And yeah, once you have the length of the edge cross product, you can (and probably should) normalise the normal.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!