From: Jack on
I ran into a nasty problem that I could not solve on top
of my thick head. So you might be able to help me.
Given a rectangle (rendered from a bitmap perhaps)
in the window client area, how can you find its
four corners coordinates, hence also finding its width
and height. I meant this is a bare minimal case without any
other further info despite of the only image on the
screen. It maybe easy, but I've pondered it for a long time already.
Thanks
Jack


From: Igor Tandetnik on
Jack <jl(a)knight.com> wrote:
> Given a rectangle (rendered from a bitmap perhaps)
> in the window client area, how can you find its
> four corners coordinates, hence also finding its width
> and height.

When you say "given a rectangle" - what exactly are you "given"? What is the input for this problem?
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is hard to be sure where they are going to land, and it could be dangerous sitting under them as they fly overhead. -- RFC 1925

From: Jack on
Hi Igor,
I am on a rectangle partitioning problem. I want to
identify the 4 vertices of the rectangle on screen (window client area to be
more specifically).
First, I have a 3D model and I project it onto a 2D ground image. The 3D
model is created by our artist.
Next, I want to generate a navigation mesh based on the obstacles and empty
spaces available in the picture.
Thanks
Jack



From: Igor Tandetnik on
Jack <jl(a)knight.com> wrote:
> Hi Igor,
> I am on a rectangle partitioning problem. I want to
> identify the 4 vertices of the rectangle on screen (window client
> area to be more specifically).
> First, I have a 3D model and I project it onto a 2D ground image. The
> 3D model is created by our artist.
> Next, I want to generate a navigation mesh based on the obstacles and
> empty spaces available in the picture.

I'm not a graphics expert by any stretch, but taking a vector model, rasterizing it, then trying to discern vector information back from a raster image strikes me as a decidedly misguided approach. Can't you calculate the coordinates you want directly from the model?
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is hard to be sure where they are going to land, and it could be dangerous sitting under them as they fly overhead. -- RFC 1925

From: Jack on
Picture Illustration:


1) I have the large rectangle, this emcompasses 1,2,3,4,5 and the obstacle in solid black
2) I Know each "large" rectangle is 200x200 pixels
3) Let say I divide the white spaces into 5 smaller rectangles as shown
4) Along the edge on the bottom of rectangle 1, I draw a line. This has no specific impact of the image
5) Next, I draw the second line which is vertical, and formed the rectangle which includes rectangle 1 and 2
6) Then, I draw the third line along the top edge of the obstacle, this in fact divides rectangle 1 and 2
7) so on so forth
8) I need to calculate each rectangle's x,y coordinates and their sizes.

I am not sure whether I can work out the figures prior to finishing all the partitioning.
I guess I need to finish the partitioning first, then figure out the rectangles afterwards...
And that's why I get to here
Thanks
Jack