fogón

← ArmasObjeto 3Dfogon/arma-uzi

Uzi

de fogonCC07553 bloques
UziArrastrá para girarlo
// «Uzi» · propio
// ONE single compact black submachine gun (uzi style), just one gun, with a long magazine. It lies on its side like a gun dropped on a table: the side of the gun faces up (+z), the grip and magazine point sideways along +x.

const colors = () => {};
const BLACK  = "#0d0d11";
const DARK   = "#1b1b21";
const BODY   = "#26262e";
const LIT    = "#363641";
const EDGE   = "#4b4b58";
const STEEL  = "#5b5b69";
const STEEL2 = "#7a7a8c";
const GRIP   = "#1f1f26";
const GRIPH  = "#2e2e38";
const MAG    = "#222229";
const MAGH   = "#33333d";

part("body");

/* ---------------- MAIN RECEIVER ---------------- */
box(8, 14, 0, 21, 36, 10, BODY);
box(8, 36, 0, 21, 38, 10, DARK);      // rear cap
box(8, 12, 0, 21, 14, 10, DARK);      // front block
box(5, 14, 1, 8, 34, 9, DARK);        // top cover ridge (gun's top edge)
box(5, 14, 9, 8, 34, 9, LIT);         // ridge highlight
box(8, 15, 10, 8, 35, 10, EDGE);      // visible-side top edge line
box(21, 15, 10, 21, 35, 10, DARK);    // visible-side bottom edge line

/* ejection port recess */
box(11, 28, 10, 19, 34, 10, BLACK);
box(11, 27, 10, 19, 27, 10, EDGE);
box(11, 28, 10, 11, 34, 10, EDGE);

/* selector knob */
cylinder(15, 24, 10, 2, 2, STEEL, "z");

/* engraved side lines */
box(10, 16, 10, 10, 24, 10, EDGE);
box(18, 16, 10, 18, 21, 10, DARK);

/* status display bezel */
box(16, 15, 10, 21, 20, 10, BLACK);

/* ---------------- BARREL ---------------- */
cylinder(13, 3, 5, 3, 12, STEEL, "y");
cylinder(13, 2, 5, 4, 2, EDGE, "y");
box(12, 2, 4, 14, 3, 6, BLACK);       // bore
box(7, 5, 4, 10, 7, 6, STEEL2);       // front sight post
box(4, 30, 3, 7, 33, 7, STEEL2);      // rear sight
box(5, 31, 4, 6, 32, 6, BLACK);       // rear aperture

/* ---------------- PISTOL GRIP ---------------- */
for (let x = 21; x <= 32; x++) {
  const s = Math.round((x - 21) * 0.18);
  box(x, 20 + s, 1, x, 29 + s, 9, GRIP);
}
for (let x = 23; x <= 31; x += 2) {
  const s = Math.round((x - 21) * 0.18);
  box(x, 21 + s, 9, x, 28 + s, 9, GRIPH);
}

/* ---------------- LONG MAGAZINE ---------------- */
for (let x = 30; x <= 44; x++) {
  box(x, 22, 2, x, 29, 8, MAG);
}
for (let x = 34; x <= 42; x += 3) {
  box(x, 24, 8, x, 25, 8, DARK);      // witness holes
}
box(43, 21, 1, 45, 30, 9, STEEL);     // floor plate
box(43, 21, 9, 45, 30, 9, STEEL2);

/* ---------------- TRIGGER GUARD ---------------- */
box(21, 16, 3, 25, 18, 7, DARK);
box(24, 16, 3, 26, 27, 7, DARK);
box(21, 25, 3, 26, 27, 7, DARK);

/* ---------------- WIRE STOCK ---------------- */
box(9, 38, 3, 11, 44, 7, STEEL);
box(19, 38, 3, 21, 44, 7, STEEL);
box(8, 43, 2, 22, 45, 8, DARK);       // butt plate
box(8, 43, 8, 22, 45, 8, LIT);

/* ---------------- BOLT / CHARGING HANDLE (moves) ---------------- */
part("bolt", [4, 24, 5]);
box(3, 22, 3, 6, 27, 7, STEEL);
box(2, 23, 4, 3, 26, 6, STEEL2);

/* ---------------- TRIGGER (moves) ---------------- */
part("trigger", [21, 20, 5]);
box(21, 20, 4, 23, 23, 6, STEEL);
box(22, 22, 4, 23, 23, 6, STEEL2);

/* ---------------- SURFACE VARIATION ---------------- */
forEach((x, y, z, c) => {
  const r = rand();
  if (c === BODY) {
    if (r < 0.10) set(x, y, z, LIT);
    else if (r < 0.19) set(x, y, z, DARK);
  } else if (c === DARK) {
    if (r < 0.13) set(x, y, z, BODY);
  } else if (c === GRIP) {
    if (r < 0.12) set(x, y, z, GRIPH);
  } else if (c === MAG) {
    if (r < 0.12) set(x, y, z, MAGH);
  } else if (c === STEEL) {
    if (r < 0.12) set(x, y, z, STEEL2);
  } else if (c === STEEL2) {
    if (r < 0.10) set(x, y, z, EDGE);
  }
});

/* ---------------- GLOWING STATUS SCREEN ---------------- */
part("led");
box(17, 16, 10, 20, 18, 10, "#39ff9e");

colors("led", { palette: ["#39ff9e", "#0d8f57", "#b6ffd9"], pattern: "pulse", speed: 1.1, glow: 0.9 });

void ("bolt",    { type: "bob",   axis: "y", speed: 1.6,  amplitude: 2 });
void ("trigger", { type: "swing", axis: "z", speed: 2.4,  amplitude: 0.18 });