code wiki / (root) / nx_body_figure.nx

nx_body_figure.nx source

↩ module page · 42 lines · 2369 B

1// nx_body_figure.nx -- ANATOMICAL BODY FIGURE for the synthetic-character sandbox (/charlab, the VaM-class adult 2// workstream -- FICTIONAL/GENERATED characters, NEVER real-photo nudify=NCII). The "undress" of a SYNTHETIC 3// character = its base body rendered without the outfit layer (nx_outfit); this gives that nude body a real 4// sex-DIMORPHIC anatomical FORM instead of the genderless mannequin -- the same body-proportion morph a character 5// creator (VaM/game) exposes. Reshapes the humanoid torso ellipsoids (chest/waist/hips) by figure. Composes with 6// nx_outfit (clothed <-> unclothed) and nx_assetvariant (species/build). Measured to body FORM (proportions), 7// the anatomy pillar; belongs behind the /charlab adult gate, NOT the public /synth page. license_tier: ORIGINAL 8import "nx_syscalls.nx" 9import "nx_sdfrender.nx" 10 11const FIG_NEUTRAL: i64 = 0 // the default mannequin (androgynous) 12const FIG_FEM: i64 = 1 // fuller chest, narrower waist, wider hips 13const FIG_MASC: i64 = 2 // broader chest/shoulders, straighter waist, narrower hips 14 15// scale a part's radii + optionally nudge its y. idx into O_PARTS (6 slots {cx,cy,cz,rx,ry,rz}). 16func fig_scale(base: i64, idx: i64, sx: i64, sy: i64, sz: i64) -> i64 { 17 let p: *i64 = (base + O_PARTS) as *i64 18 p[idx*6+3] = p[idx*6+3] * sx / 100 19 p[idx*6+4] = p[idx*6+4] * sy / 100 20 p[idx*6+5] = p[idx*6+5] * sz / 100 21 return 0 22} 23// apply a sex-dimorphic body FORM to a humanoid base already built into `base`. Human part layout (av_base_human): 24// 2=chest, 3=waist, 4=hips. Percentages are body-proportion morphs (clinical silhouette), the anatomy pillar. 25func figure_apply(base: i64, figure: i64) -> i64 { 26 if figure == FIG_FEM { 27 fig_scale(base, 2, 108, 100, 106) // chest: fuller/deeper 28 fig_scale(base, 3, 82, 100, 84) // waist: narrower (the waist-hip ratio cue) 29 fig_scale(base, 4, 120, 100, 116) // hips: wider 30 } 31 if figure == FIG_MASC { 32 fig_scale(base, 2, 120, 104, 112) // chest/shoulders: broader, squarer 33 fig_scale(base, 3, 100, 100, 100) // waist: straight 34 fig_scale(base, 4, 86, 100, 90) // hips: narrower 35 } 36 return 0 37} 38func figure_name(f: i64) -> *u8 { 39 if f == 1 { return "feminine" as *u8 } 40 if f == 2 { return "masculine" as *u8 } 41 return "neutral" as *u8 42}