floor explainer: no side view or header, pink labelled allowance, all polygon numbers in the zoom
This commit is contained in:
1 parent
74f8fec341
commit
15ad050005
2 files changed
+10
-28
No files matched your search
Binary file not shown.
|
Before Width: | Height: | Size: 362 KiB After Width: | Height: | Size: 321 KiB |
@@ -55,9 +55,12 @@ def collision(d, P, labels, sliver=None, fsz=12):
|
||||
pts = [P(p[0], p[2]) for p in C]
|
||||
if i in (11, 15): d.polygon(pts, fill=RED + (70,))
|
||||
d.line(pts + pts[:1], fill=col, width=wid * SS)
|
||||
if labels and (labels == 'all' or i in labels):
|
||||
if labels:
|
||||
cx = sum(p[0] for p in pts) / len(pts); cy = sum(p[1] for p in pts) / len(pts)
|
||||
txt = str(i) if labels == 'all' else f'poly {i} · mat {r[1]}'
|
||||
lim = d.im.size
|
||||
if not (10 * SS < cx < lim[0] - 10 * SS and 10 * SS < cy < lim[1] - (80 if labels == 'zoom' else 10) * SS):
|
||||
continue
|
||||
txt = f'poly {i} · mat {r[1]}' if labels == 'zoom' and i in (2, 11, 15) else str(i)
|
||||
d.text((cx, cy), txt, fill=col, font=F(fsz, i in (2, 11, 15)), anchor='mm',
|
||||
stroke_width=SS * 2, stroke_fill='white')
|
||||
|
||||
@@ -93,7 +96,7 @@ ov = ov.resize((640, 640), Image.LANCZOS)
|
||||
|
||||
# --- right: zoom on the crate's side with both needles ---
|
||||
zm, d, P, S = panel(ZX0, ZZ0, ZSP, 820, True)
|
||||
collision(d, P, [2, 11, 15], sliver=sliver_cells(ZX0, ZZ0, ZX0 + ZSP, ZZ0 + ZSP, 0.0012), fsz=15)
|
||||
collision(d, P, 'zoom', sliver=sliver_cells(ZX0, ZZ0, ZX0 + ZSP, ZZ0 + ZSP, 0.0012), fsz=15)
|
||||
k = P(K[0], K[2]); r = 9 * SS
|
||||
d.ellipse([k[0] - r, k[1] - r, k[0] + r, k[1] + r], fill=MAG, outline='black', width=2 * SS)
|
||||
d.text((k[0], k[1] + 30 * SS), 'Kuzco\n57.204 / 43.733\n(measured live)', fill=MAG, font=F(15, True), anchor='ma',
|
||||
@@ -105,33 +108,12 @@ for xq in (k[0], tip[0]): d.line([(xq, y - 8 * SS), (xq, y + 8 * SS)], fill='bla
|
||||
d.text(((k[0] + tip[0]) / 2, y - 6 * SS), '0.11 outside poly 15', fill='black', font=F(14, True), anchor='md',
|
||||
stroke_width=SS * 2, stroke_fill='white')
|
||||
d.text((P(57.38, 43.80)), 'needle tips 13.5°', fill=RED, font=F(14, True), stroke_width=SS * 2, stroke_fill='white')
|
||||
d.text((P(ZX0 + 0.01, ZZ0 + 0.035)), 'pink = where the engine still takes the needle as floor\n(edge tolerance ≈ 0.02 → sliver ≈ 0.19 long, 0.01 wide)',
|
||||
d.text((P(ZX0 + 0.01, ZZ0 + 0.035)), 'pink = allowance: where the engine still takes the needle as floor\n(edge tolerance ≈ 0.02 → ≈ 0.19 long, 0.01 wide at a 13.5° tip)',
|
||||
fill=(190, 20, 110), font=F(14, True), stroke_width=SS * 2, stroke_fill='white')
|
||||
zm = zm.resize((820, 820), Image.LANCZOS)
|
||||
|
||||
# --- bottom: side view ---
|
||||
sv = Image.new('RGB', (W * SS, 300 * SS), 'white'); d = ImageDraw.Draw(sv)
|
||||
H = lambda v: (270 - (v - 2.2) * 600) * SS
|
||||
x0, x1 = 80 * SS, 900 * SS
|
||||
d.line([(x0, H(2.270)), (x1, H(2.270))], fill=BLUE, width=6 * SS)
|
||||
for i in range(x0, x1, 28 * SS): d.line([(i, H(2.474)), (i + 14 * SS, H(2.474))], fill=RED, width=5 * SS)
|
||||
kx = 300 * SS
|
||||
d.rectangle([kx - 16 * SS, H(2.474 + 0.12), kx + 16 * SS, H(2.474)], outline=MAG, width=3 * SS)
|
||||
d.text((kx + 24 * SS, H(2.474 + 0.06)), "Kuzco's feet", fill=MAG, font=F(15, True), anchor='lm')
|
||||
d.line([(560 * SS, H(2.474)), (560 * SS, H(2.270))], fill='black', width=2 * SS)
|
||||
d.text((572 * SS, (H(2.474) + H(2.270)) / 2), '0.20 in the air', fill='black', font=F(17, True), anchor='lm')
|
||||
d.text((x1 + 20 * SS, H(2.474)), 'poly 15 plane extended to Kuzco: y 2.474 ← chosen', fill=RED, font=F(16, True), anchor='lm')
|
||||
d.text((x1 + 20 * SS, H(2.270)), 'poly 2 (path) really under Kuzco: y 2.270', fill=BLUE, font=F(16, True), anchor='lm')
|
||||
d.text((20 * SS, 14 * SS), 'Side view at Kuzco\'s position: the game takes the highest passing floor up to feet + 0.25', fill='black', font=F(20, True))
|
||||
sv = sv.resize((W, 300), Image.LANCZOS)
|
||||
|
||||
out = Image.new('RGB', (W, 110 + 820 + 300 + 20), 'white')
|
||||
out = Image.new('RGB', (20 + 640 + 20 + 820 + 20, 820 + 40), 'white')
|
||||
d = ImageDraw.Draw(out)
|
||||
d.text((20, 14), 'Why Kuzco stands in the air next to the crate · Jungle Day 2 (t1l4m002), tile 443', fill='black', font=ImageFont.truetype('DejaVuSans-Bold.ttf', 26))
|
||||
d.text((20, 54), 'Top view, colours = terrain height, green lines = grid cells, numbers = collision polygons of tile 443 (all material 0). '
|
||||
'Red = the two needle triangles 11 and 15 (steep crate bevels),\nblue = poly 2 (the path). Units = grid cells; Kuzco is about 0.6 tall.',
|
||||
fill=(60, 60, 60), font=ImageFont.truetype('DejaVuSans.ttf', 15))
|
||||
out.paste(ov, (20, 110 + 90)); out.paste(zm, (680, 110))
|
||||
d.text((20, 110 + 60), 'Overview (3 × 3 cells), orange box = zoom →', fill='black', font=ImageFont.truetype('DejaVuSans-Bold.ttf', 17))
|
||||
out.paste(sv, (0, 110 + 820 + 20))
|
||||
out.paste(ov, (20, 20 + 90)); out.paste(zm, (680, 20))
|
||||
d.text((20, 20 + 60), 'Overview (3 × 3 cells), orange box = zoom →', fill='black', font=ImageFont.truetype('DejaVuSans-Bold.ttf', 17))
|
||||
out.save(OUT); print('saved', OUT, out.size)
|
||||
Reference in new issue
Block a user