Tessellate a plane

Started by
24 comments, last by eq 17 years, 4 months ago
Quote:Original post by jeff_rowa
to illustrate it

D-----------------------C
| |
| |
| |
| |
| |
A-----------------------B

I have position of A and C.


It's not solvable. Even with the normal, there are an infinite number of rectangles you can have in that plane given the diagonal there. I mean, just taking your diagram:

                    ---D                 --/    C              --/   /---          ---/   /--           --/    /--           --/    /--           --/    /--             A    /--                 B---


Same diagonal, same plane, different rectangle.

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

Advertisement
Quote:Original post by superpig
Quote:Original post by jeff_rowa
to illustrate it

D-----------------------C
| |
| |
| |
| |
| |
A-----------------------B

I have position of A and C.


It's not solvable. Even with the normal, there are an infinite number of rectangles you can have in that plane given the diagonal there. I mean, just taking your diagram:

                    ---D                 --/    C              --/   /---          ---/   /--           --/    /--           --/    /--           --/    /--             A    /--                 B---


Same diagonal, same plane, different rectangle.
He does have the dimensions as well, which reduces it to two choices (and it's possible that could be disambiguated further by other contraints, such as axis alignment or winding).

Still, this seems like a pain. So to the OP, I'll ask again: what is this for exactly, and why this representation? There are a number of other representations for a rectangle in 3D that would be much more convenient.
tnx guyz for your replies, but could you please tell me what's the best way of representing 3D rectangle?
cos I think by having two points which are the opposite corners and a normal to that surface you should be able to define that rectangle.
Quote:Original post by jeff_rowa
cos I think by having two points which are the opposite corners and a normal to that surface you should be able to define that rectangle.
Nope. As noted previously, in the absence of additional information there is an infinite number of solutions. Knowing the dimensions of the rectangle makes the number of solutions finite, but there is still ambiguity.

A better representation would be a center point and two orthonormal basis vectors (a coordinate frame), and the dimensions (width and height). Other variations of this that offered essentially the same information would work as well.
Quote:Original post by jeff_rowa
... by the way, all the rectangles are aligned to one of the X,Y or Z axis.


I think he means it's an axis aligned rect.
yeah, exactly, I meant a rectangle with angles equal 90 degrees.
Quote:Original post by jeff_rowa
yeah, exactly, I meant a rectangle with angles equal 90 degrees.
That's not what 'axis aligned' means; 'axis aligned' means aligned with the global/world (cardinal) axes.
oh, sorry :)
I think I found a way for solving it, by having opposite corners and knowing the angle is 90 and the normal:
since normal is always one of the i,j or k vectors, it should looks like as if rectangle is drawn in 2D. So for instance if one corner is 0,0,0 and the other is 1,1,0 there should be a way to calculate the two other points which are 1,0,0 and 0,1,0.
cos the normal is also 0,0,1
I think it's solveable only if you're saying it's a square, not a rectangle.

Consider the 2d case:

In the upper row you clearly see that you can form several rectangles from the same two points.
In the lower row you see that you can only build one square from two points.

It works exactly the same in 3d but with the exception that you need a normal to define the plane, otherwise you'll have an infinite number of squares rotated arounf the axis formed by the two points.

Hi eq,
tnx for your reply, yeah I meant square, sorry about my english guyz!!, so by saying that I want to draw a square, how can I calculate the other two points based on the other two points that you marked in your diagram and the normal in 3D.

This topic is closed to new replies.

Advertisement