views:

17

answers:

1

As an input, I receive some planar, triangulated geometry. Now, I need to compute the four coordinates of the corners of the bounding rectangle. Any Ideas?

+1  A: 

I'm going to assume that you mean 2D space in the question title, because everything else refers to 2D.

Go through all the vertices (x,y) in your geometry, and calculate the maximum and minimum of the x's, and the max and min of the y's.

Then the vertices of your bounding rectangle will be (min_x,min_y), (max_x,min_y), (max_x, max_y), and (min_x, max_y).

brainjam
Unless the rectangle can be rotated :) OP never specified
BlueRaja - Danny Pflughoeft