View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# Compute project triangle's area

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

6 replies to this topic

### #1sienaiwun  Members

Posted 12 May 2013 - 10:17 PM

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.

### #2Steve_Segreto  Members

Posted 12 May 2013 - 11:58 PM

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, 13 May 2013 - 12:08 AM.

### #3sienaiwun  Members

Posted 13 May 2013 - 02:39 AM

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, 13 May 2013 - 02:42 AM.

### #4hupsilardee  Members

Posted 13 May 2013 - 08:03 AM

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

### #5Álvaro  Members

Posted 13 May 2013 - 08:26 AM

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.

### #6Steve_Segreto  Members

Posted 13 May 2013 - 09:46 AM

Thanks for the correction Hupsilardee and Alvaro!

### #7hupsilardee  Members

Posted 13 May 2013 - 04:39 PM

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.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.