diff --git a/docs/design/cuberenderimgs/chunk_height.png b/docs/design/cuberenderimgs/chunk_height.png index a2d5ce4..faaab4d 100644 Binary files a/docs/design/cuberenderimgs/chunk_height.png and b/docs/design/cuberenderimgs/chunk_height.png differ diff --git a/docs/design/cuberenderimgs/chunk_height.svg b/docs/design/cuberenderimgs/chunk_height.svg index 532e06c..e353b22 100644 --- a/docs/design/cuberenderimgs/chunk_height.svg +++ b/docs/design/cuberenderimgs/chunk_height.svg @@ -15,7 +15,7 @@ version="1.1" inkscape:version="0.48.1 r9760" sodipodi:docname="chunk_height.svg" - inkscape:export-filename="/home/andrew/mc/overviewer/docs/design/cuberenderimgs/chunk_height.png" + inkscape:export-filename="/home/andrew/mc/overviewer/anvil/docs/design/cuberenderimgs/chunk_height.png" inkscape:export-xdpi="110.02" inkscape:export-ydpi="110.02"> + style="fill:#ff0000;fill-opacity:1;stroke:none" + d="m 646.53794,494.12249 12,6 12,-6 -12,-6 z" + id="path10400-9-28" + inkscape:connector-curvature="0" + sodipodi:nodetypes="ccccc" /> + style="fill:#ff0000;fill-opacity:1;stroke:none" + d="m 646.53794,506.12249 12,6 12,-6 -12,-7 z" + id="path10400-9-35" + inkscape:connector-curvature="0" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + style="fill:#ff0000;fill-opacity:1;stroke:none" + d="m 646.53794,518.12249 12,6 12,-6 -12,-7 z" + id="path10400-9-09" + inkscape:connector-curvature="0" /> + + + + + + + + + + - - + d="m 646.53794,673.12249 0.0721,181 11.92792,5 11.92792,-5 0.0721,-180 -12,-6 z" + id="path9025" + inkscape:connector-curvature="0" + sodipodi:nodetypes="ccccccc" /> + id="g9807" + transform="translate(33.390161,0.4067731)"> + transform="translate(607.5,121.30871)" + id="g8687"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + id="g9090-1" + transform="translate(368.5,5.8087156)"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - 1524 - - 1704 - - - - - - 1728 diff --git a/docs/design/cuberenderimgs/cube_stack128.png b/docs/design/cuberenderimgs/cube_stack128.png deleted file mode 100644 index 3045075..0000000 Binary files a/docs/design/cuberenderimgs/cube_stack128.png and /dev/null differ diff --git a/docs/design/cuberenderimgs/cube_stack16.png b/docs/design/cuberenderimgs/cube_stack16.png new file mode 100644 index 0000000..675d962 Binary files /dev/null and b/docs/design/cuberenderimgs/cube_stack16.png differ diff --git a/docs/design/cuberenderimgs/cube_stack128.svg b/docs/design/cuberenderimgs/cube_stack16.svg similarity index 71% rename from docs/design/cuberenderimgs/cube_stack128.svg rename to docs/design/cuberenderimgs/cube_stack16.svg index 8624a16..5f75e34 100644 --- a/docs/design/cuberenderimgs/cube_stack128.svg +++ b/docs/design/cuberenderimgs/cube_stack16.svg @@ -14,8 +14,8 @@ id="svg2" version="1.1" inkscape:version="0.48.1 r9760" - sodipodi:docname="cube_stack128.svg" - inkscape:export-filename="/home/andrew/mc/overviewer/docs/design/cuberenderimgs/cube_stack128.png" + sodipodi:docname="cube_stack16.svg" + inkscape:export-filename="/home/andrew/mc/overviewer/anvil/docs/design/cuberenderimgs/cube_stack16.png" inkscape:export-xdpi="90.016075" inkscape:export-ydpi="90.016075"> Y Offset - - 0 - 12 - 24 - Block # - - 0 - 1 - 2 - 127 - 126 - 125 - 1500 - 1512 - 1524 - 12*128=1536 + x="145.19473" + y="473.9852">12*16=192 + + + 12 + + 12 + + + 6 + 6 + + + + + + 204 diff --git a/docs/design/designdoc.rst b/docs/design/designdoc.rst index 9322a1f..493077b 100644 --- a/docs/design/designdoc.rst +++ b/docs/design/designdoc.rst @@ -307,52 +307,40 @@ directions of the offsets are changed, but the amounts are the same. The size of a chunk ------------------- Now that we know how to place blocks relative to each other, we can begin to -construct a chunk section. +construct an entire chunk section. Since the block sprites are 24 by 24 pixels, and the diagonal of the 16 by 16 -grid is 16 squares, the width of one rendered chunk will be 384 pixels. Just -considering the top layer of the blocks: +grid is 16 squares, the width of one rendered chunk section will be 384 pixels. +Just considering the top layer of blocks within a section: .. image:: cuberenderimgs/chunk_width.png :alt: Illustrating the width of a single chunk -Since cubes next to each other in the same "diagonal row" are offset by 24 +Since blocks next to each other in the same "diagonal row" are offset by 24 pixels, this is trivially calculated. The height is a bit more tricky to calculate. Let's start by calculating the -height of a single stack of 128 cubes. +height of a single stack of 16 blocks. -If the top of a stack of cubes is at Y value 0, the 128th cube down must be -drawn (128-1)*12=1524 pixels below. However, that's not the end of the story. -The bottom cube has a height of 24 pixels, so the height of a rendered stack of -128 cube is 1548 pixels. +The non-overlapping edge of each block sprite is 12 pixels high. Since there are +16 blocks in this stack, that's 192 pixels high. There are also 6 additional +pixels at the top and bottom of the stack as shown, giving a total height of 204 +pixels. -.. image:: cuberenderimgs/cube_stack128.png - :alt: A stack of 128 cubes takes 1560 vertical pixels to draw. +.. image:: cuberenderimgs/cube_stack16.png + :alt: A stack of 16 cubes takes 204 vertical pixels to draw. -You can also calculate this by looking at the sides of the cubes, which don't -overlap at all. They are 12 pixels each, times 128 cubes in the stack, gives -1536 pixels. Add in the 6 pixels for the top cube and the 6 pixels for the -bottom cube to get the total height of 1548 pixels. - -So what about the entire chunk? Let's take a look at the top and bottom few -layers of a chunk. +But that's just for one column of blocks. What about the entire chunk section? +Take a look at this diagram: .. image:: cuberenderimgs/chunk_height.png :alt: The highest and lowest positioned cubes in a chunk -Let's let the red cubes represent the stack from above. The one on the top we'll -define as position 0, with our vertical axis running positively downward (as is -the case in a lot of imaging library coordinate systems) Therefore, the bottom -red cube is at vertical offset 1524 below. +The green highlighted blocks are the stack we calculated just above and have a +height of 204 pixels. The red highlighted blocks each take 12 pixels of vertical +space on the image, and there are 15 of them. So 204 + 12*15 is 384 pixels. -The green cube at the bottom most tip is the cube with the lowest vertical -placement on the image, so its offset plus 24 pixels for its height will be the -chunk height. Since the green cubes each have an offset of 12 pixels, add 15*12 -pixels to get the offset of the lowest green cube: 1704. - -So the total size of a chunk in pixels is 384 wide by 1728 tall. That's pretty -tall! +So the total size of a chunk section in pixels is 384 wide by 384 tall. Assembling a Chunk ------------------