• Advertisement
Sign in to follow this  

Compute project triangle's area

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

Hi.

  I want to compute several triangle models' projective area on the view plane. My current method is that I write a soft-ware rasterizer and do the rectangle culling of triangle pixels out of the view rectangle and then computer the area.

 As there is no hard-ware culling, it's time consuming. I wonder is there any idea of another way of triangle culling.

 For example, can the triangles be parameterized into a vector, and do a 2D vector culling? Is there any paper about it?

 Or as the area could be coarse, is there any better parameter way?

Sincere.

Share this post


Link to post
Share on other sites
Advertisement

http://www.gamedev.net/topic/485795-projected-area-of-triangle/

 

Some other ideas are this ...

 

Use D3DXVec3Project to take each point of a triangle and project it to screen space.

 

Take the cross product of any two screen space triangle points. This is twice the area of the triangle (in screen space).

Edited by Steve_Segreto

Share this post


Link to post
Share on other sites

http://www.gamedev.net/topic/485795-projected-area-of-triangle/

 

Some other ideas are this ...

 

Use D3DXVec3Project to take each point of a triangle and project it to screen space.

 

Take the cross product of any two screen space triangle points. This is twice the area of the triangle (in screen space). 

    Thanks very much. As the area is computed without D3D or OPENGL, I must write my own rasterizer.

    I wonder if the triangles can be paremeterized into a vector, like spherical harmonics way. And the vector can by projected on a plane. Is there some ways.

    Sincere.

Edited by sienaiwun

Share this post


Link to post
Share on other sites

http://www.gamedev.net/topic/485795-projected-area-of-triangle/

 

Some other ideas are this ...

 

Use D3DXVec3Project to take each point of a triangle and project it to screen space.

 

Take the cross product of any two screen space triangle points. This is twice the area of the triangle (in screen space).

 

Slightly incorrect. If you take the cross product of two points as position vectors, the magnitude of the resulting vector will be equal to the area of the triangle formed from the two points and the origin, which you don't want.

 

To calculate the area of the triangle formed by the points A, B and C, calculate the normal to the triangle by n = (B - A) x (C -A). The area is the length of that normal.

 

Pointless but interesting extra maths fact: if A, B, C are transformed by a linear transformation represented by matrix M, the area will be multiplied by the determinant of M. (Note projection matrix is NOT a linear transform ;))

Share this post


Link to post
Share on other sites

Pointless but interesting extra maths fact: if A, B, C are transformed by a linear transformation represented by matrix M, the area will be multiplied by the determinant of M. (Note projection matrix is NOT a linear transform ;))

Replace "linear" with "affine" in that sentence, and then it makes sense.

Share this post


Link to post
Share on other sites

Pointless but interesting extra maths fact: if A, B, C are transformed by a linear transformation represented by matrix M, the area will be multiplied by the determinant of M. (Note projection matrix is NOT a linear transform ;))

Replace "linear" with "affine" in that sentence, and then it makes sense.

 

Oops. An affine transform is a linear transform followed by a translation.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement