Compute project triangle's area

Started by
5 comments, last by hupsilardee 10 years, 11 months ago

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.

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).

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.

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 ;))

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.

Thanks for the correction Hupsilardee and Alvaro!

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.

This topic is closed to new replies.

Advertisement