Jump to content

  • Log In with Google      Sign In   
  • Create Account


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.

  • You cannot reply to this topic
6 replies to this topic

#1 sienaiwun   Members   -  Reputation: 128

Like
0Likes
Like

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.



Sponsor:

#2 Steve_Segreto   Crossbones+   -  Reputation: 1509

Like
0Likes
Like

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.


#3 sienaiwun   Members   -  Reputation: 128

Like
0Likes
Like

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.


#4 hupsilardee   Members   -  Reputation: 486

Like
3Likes
Like

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   Crossbones+   -  Reputation: 12866

Like
1Likes
Like

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.

#6 Steve_Segreto   Crossbones+   -  Reputation: 1509

Like
0Likes
Like

Posted 13 May 2013 - 09:46 AM

Thanks for the correction Hupsilardee and Alvaro!



#7 hupsilardee   Members   -  Reputation: 486

Like
0Likes
Like

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.



PARTNERS