Height, top, base of inside an irregular pyramid

Frankydee

New member
For a personal projet, I'm looking for a formula to find dimensions of a base inside an irregular pyramid.
I've been searching but now I'm at a loss.

In the diagram attached, what would be : xh1, xh2, xt1 and xb1 ?

I could have all other data : t, b, h1, h2 (which are constants) and lg, d1, d2, d3, d4.
Do not have the angle. It varies since pk can be situated anywhere.

I'm available if you need additional info.

Thank you very much for you help. Attachments

• 38.2 KB Views: 7

Dr.Peterson

Elite Member
Are the two rectangles in parallel planes? Is lg measured midpoint-to-midpoint, so that it is a segment of a median of a triangle with sides d1, d2, and b/2?

Or are those not rectangles at all, as implied by the sides being named differently? If so, then we don't have enough information to know their shapes - we'd need at least one angle or diagonal in the "rectangles".

Is there any additional information available? For instance, could the various points be given by coordinates?

Dr.Peterson

Elite Member
If the larger quadrilateral is a rectangle, then the smaller one can't be a rectangle f it is not parallel. Only parallel slices of a pyramid are similar to the base.

It looks now like pk is the eye position and the smaller plane is a viewing plane, perpendicular to the line of sight to the center of the rectangle, but at a fixed distance from the rectangle rather than from the eye.

Is it really necessary to use d1, d2, d3, and d4 as the only data locating pk? It would be much easier to go by coordinates.

You may want to go through a book on computer graphics, even if that's not what you're doing. Vector methods would be useful, and in any case it would be helpful if we knew what knowledge you have in this area, and what parts you need help with.

Ok thank you !

LCKurtz

Junior Member
I think you have some constraints. If I understand it correctly, lg is on the line between the center of the large rectangle and the apex pk, and the second "rectangle" is perpendicular to the red line. I don't see that you can give us lg and also d1,d2,d3,d4 because it looks to me like the location of pk and the distance lg determines the di's. And I don't think the smaller rectangle is in fact a rectangle.

Dr.Peterson

Elite Member
My understanding is that the location of pk is implied by the d's (distances from pk to the vertices of the big rectangle), not provided separately. That's why I asked about coordinates (for pk) which would make it possible to determine the d's, whereas the coordinates of pk could be determined from the d's, but with a lot more work. If I were to try to solve this, I would use coordinates, and some vector and matrix algebra, most of which is probably standard in 3-d graphics work.

LCKurtz

Junior Member
My understanding is that the location of pk is implied by the d's (distances from pk to the vertices of the big rectangle), not provided separately. That's why I asked about coordinates (for pk) which would make it possible to determine the d's, whereas the coordinates of pk could be determined from the d's, but with a lot more work. If I were to try to solve this, I would use coordinates, and some vector and matrix algebra, most of which is probably standard in 3-d graphics work.
Yes. I have seen a bit about "viewports" in computer graphics and I'm pretty sure what he needs is standard matrix stuff. What bothered me in his post #1 was this quote:
I could have all other data : t, b, h1, h2 (which are constants) and lg, d1, d2, d3, d4.
Do not have the angle. It varies since pk can be situated anywhere.
which implies to me he thinks that pk and the di's are independent.

[Edit, added:] Doing a quick Google search on viewport calculation I found this link, among others:
I'm pretty sure the OP could find what he needs with a bit of searching.

Last edited:

Frankydee

New member
Same diagram with some coordinates.

Think of a person looking out a window but at an angle at distance dp.
Note that the smaller window can be at either z=2 or z=4 and it is perpendicular to the person, not parallel to the larger window.
Let's have a smaller window not slanted in any way. More like my first diagram above.

I can measure from (0,0,0) the distance from the person to the larger window on z axis. Let's say dp=9.
As an example, since the smaller window could be at z1=2 or z2=4, the person would at a z=7 or z=5 of distance of the smaller window respectively.

I need to determine the size of the smaller window at z=2 or z=4 if a person is at z=dp

dp is measured form various points but always at axis y=0

Hope this helps. Attachments

• 41.8 KB Views: 6

Dr.Peterson

Elite Member
Think of a person looking out a window but at an angle at distance dp.
Note that the smaller window can be at either z=2 or z=4 and it is perpendicular to the person, not parallel to the larger window.
Let's have a smaller window not slanted in any way. More like my first diagram above.

I can measure from (0,0,0) the distance from the person to the larger window on z axis. Let's say dp=9.
As an example, since the smaller window could be at z1=2 or z2=4, the person would at a z=7 or z=5 of distance of the smaller window respectively.

I need to determine the size of the smaller window at z=2 or z=4 if a person is at z=dp

dp is measured form various points but always at axis y=0
Do you have coordinates for the eye position? That's something I've asked repeatedly. It's not enough to know only one distance.

If the "smaller window" is "perpendicular to the person" (which I take to mean perpendicular to the line from the eye to the origin) and "not parallel to the larger window", then it can't be said to "be at either z=2 or z=4", unless you are referring to only one point on it. (The plane z=2 is parallel to the rectangle.) I don't know what "not slanted in any way" means; I would have thought it meant parallel to the larger window (the xy plane), but you're saying it isn't.

What does it mean to say that dp is the distance "on z axis"? Clearly it is not along that axis, since the eye is not.

Now, if the eye were on the z-axis, all of this would be easy. The smaller window would be a rectangle proportional to the large one, in proportion to their distance from the eye.

And if you gave the coordinates of the eye and said that the smaller window is the intersection of a plane perpendicular to the ray from the eye to the origin, with rays from the larger rectangle, then we could work out anything you want to know about that shape -- which would not in general be a rectangle or even a parallelogram, but could be fully described.

What we lack is a real description of exactly what you are given, and what you really expect. Don't try to simplify things; that just makes it harder to communicate clearly.

LCKurtz

Junior Member
And, while you're at it, don't add unnecessary confusion by labeling your coordinates in the order (y,x,z).