# 问题内容:

Making a 4-sided pyramid is explained ‘lightly’ in a few texts, as follows:

``````pyramid.getPoints().addAll(0,0,0); //0 = top
pyramid.getPoints().addAll(0, height, -hypotenuse/2); //1 = closest
pyramid.getPoints().addAll(-hypotenuse/2, height, 0); //2 = leftest
pyramid.getPoints().addAll(hypotenuse/2, height, 0); //3 = furthest
pyramid.getPoints().addAll(0, height, hypotenuse/2); //4 = rightest

``````

It works, but I don’t understand it. See Pyramid with vertex numbering
. The 2nd face added has vertices 0, 1, 3, so (reference figure) … it slices the pyramid in half. It is not an external face as far as I can tell.
Same with the 4th face, only now the slice is orthogonal to the 2nd face. And then the last 2 faces, which should be the triangles making up the square base of the pyramid. The first one goes from vertex 4 to vertex 1 to vertex 2, so … that is the front triangle of the pyramid base (is what I think). So I expect vertices 2,3,4 to form the back triangle of the pyramid base, but in the last line of code we see vertices 4,3,1, which (according to my logic) make up the right triangle of the pyramid base, i.e. does not complement the front triangle of the pyramid base. Can someone please explain this on-the-face-of-it simple geometric puzzle? And is there a proper indepth resource out there I can study?

Much obliged – Michael

## 原文地址：

https://stackoverflow.com/questions/47755750/javefx-trianglemesh-pyramid-it-works-but-why

Tags:,