Hardware Reference
In-Depth Information
The bigger the pyramid, the longer the program will take to run and the longer
Minecraft will take to show the pyramid in the game. If your pyramid is too tall it
may also go over the maximum height of the game. So take it slowly and expand
your values gradually. You can make enormous pyramids, but you may need to be
patient if they are really big they take a while to appear!
7. For each side of the pyramid, calculate the angles of the sides of the triangle,
then use findPointOnCircle() to find the x, y, z coordinates. The angle is
calculated by dividing 360 degrees by the total number of sides, multiplied by
the number of the side which is being drawn, as you can see in FigureĀ 7-10. Type
the code as follows:
point1Angle = int(round((360 / PYRAMID_SIDES) * side,0))
point1X, point1Z = findPointOnCircle(
pyramidMiddle.x, pyramidMiddle.z,
PYRAMID_RADIUS, point1Angle)
point2Angle = int(round((360 / PYRAMID_SIDES)
* (side + 1),0))
point2X, point2Z = findPointOnCircle(
pyramidMiddle.x, pyramidMiddle.z,
PYRAMID_RADIUS, point2Angle)
FIGURE.7-10 The angles of a four-sided pyramid
Search WWH ::




Custom Search