fogón

← ArmasObjeto 3Dfogon/arma-francotirador

Rifle de francotirador

de fogonCC01452 bloques
Rifle de francotiradorArrastrá para girarlo
// «Rifle de francotirador» · propio
// A long sniper rifle: very long thin black barrel, big scope with a red lens, wooden stock.

const colors = () => {};
const W1 = "#33200e";
const W2 = "#54351a";
const W3 = "#7a4f26";
const W4 = "#9a6a35";
const W5 = "#b98a4c";
const M1 = "#0b0b0f";
const M2 = "#181820";
const M3 = "#26262f";
const M4 = "#3c3c4a";
const M5 = "#575769";
const R1 = "#6e0c12";
const R2 = "#c81c26";
const R3 = "#ff5a48";

part("body");

// ---------------- WOODEN STOCK ----------------
ellipsoid(6.5, 24, 2.5, 3.6, 3.5, 2.5, W3);
ellipsoid(4.5, 24, 2.4, 2.3, 3.2, 2.4, W2);
ellipsoid(7.5, 24, 3.4, 2.2, 2.6, 1.6, W4);

// wrist (thin part between butt and receiver)
box(8, 23, 0, 15, 25, 3, W3);
box(8, 23, 0, 15, 25, 0, W2);
box(8, 23, 3, 15, 25, 3, W4);

// cheek comb
box(9, 23, 4, 13, 25, 5, W3);
box(9, 23, 5, 13, 25, 5, W5);

// ---------------- RECEIVER ----------------
box(13, 22, 1, 26, 26, 5, M3);
box(13, 22, 1, 26, 26, 1, M2);
box(13, 22, 5, 26, 26, 5, M2);
box(13, 22, 3, 26, 22, 4, M4);
box(18, 26, 3, 23, 26, 4, M1); // ejection port

// trigger guard / trigger / magazine
box(15, 23, 0, 18, 25, 0, M2);
box(17, 24, 0, 17, 24, 0, M4);
box(20, 23, 0, 23, 25, 0, M3);

// ---------------- BARREL ----------------
box(26, 23, 2, 42, 25, 4, M3);
box(26, 22, 3, 42, 26, 3, M2);
box(26, 23, 2, 42, 25, 2, M2);
box(26, 23, 4, 42, 25, 4, M4);

// barrel bands
box(29, 21, 2, 29, 27, 4, M2);
box(36, 21, 2, 36, 27, 4, M2);

// front sight post
box(40, 24, 5, 40, 24, 5, M4);

// ---------------- MUZZLE BRAKE ----------------
box(42, 22, 1, 46, 26, 5, M2);
box(43, 22, 1, 43, 26, 5, M1);
box(45, 22, 1, 45, 26, 5, M1);
box(46, 22, 1, 46, 26, 5, M1);
box(46, 23, 2, 46, 25, 4, "#040406");

// ---------------- SCOPE ----------------
// rail / mounts
box(21, 23, 5, 26, 25, 6, M2);
// main tube
box(21, 22, 7, 32, 26, 9, M3);
box(21, 23, 6, 32, 25, 6, M2);
box(21, 23, 10, 32, 25, 10, M2);
// rings
box(24, 21, 6, 24, 27, 10, M2);
box(29, 21, 6, 29, 27, 10, M2);
// eyepiece
box(18, 21, 6, 21, 27, 10, M2);
// objective bell
box(32, 21, 6, 35, 27, 10, M2);
// turrets
box(26, 23, 11, 28, 25, 11, M4);
box(26, 27, 7, 28, 27, 9, M4);

// ---------------- RED LENSES ----------------
part("lens");
box(35, 22, 7, 35, 26, 9, R2);
box(35, 23, 8, 35, 25, 8, R3);
box(18, 22, 7, 18, 26, 9, R1);
box(18, 23, 8, 18, 25, 8, R2);
part("body");

// ---------------- BOLT HANDLE ----------------
part("bolt");
line(15, 25, 4, 16, 27, 6, 0.9, M4);
sphere(16.5, 27.5, 6.5, 1.0, M5);
part("body");

// ---------------- SUBTLE TEXTURE ----------------
forEach((x, y, z, c) => {
  if (c === W3 && rand() < 0.16) set(x, y, z, W4);
  else if (c === W3 && rand() < 0.10) set(x, y, z, W2);
  else if (c === M3 && rand() < 0.13) set(x, y, z, M4);
  else if (c === M2 && rand() < 0.10) set(x, y, z, M1);
});

// ---------------- ANIMATION ----------------
void ("bolt", { type: "swing", axis: "x", speed: 2.0, amplitude: 0.5 });
colors("lens", { palette: [R1, R2, R3, R2], pattern: "pulse", speed: 1.8, glow: 0.9 });