code wiki / _hdl_build / nx_articulate_gate.nx

nx_articulate_gate.nx

buildroot/runtime/_hdl_build/nx_articulate_gate.nx

8014 B132 linesdepth 4pulls 7 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_articulate_gate.nx -- ★R9: ARTICULATED (rigged) assets. A 2-bone-per-leg skeleton with forward kinematics, proven by the defining articulation property + a walk animation: T1 ★HIERARCHY (FK): rotating the HIP (thigh) moves the whole leg (knee AND foot); rotating the KNEE (shin) moves ONLY the lower bone (the foot moves, the knee joint does NOT) -- parent drives subtree, child doesn't T2 POSE CONTROL: the same creature in a bent pose renders visibly different from standing T3 ★WALK CYCLE: animating the joints produces distinct, PERIODIC frames (a gait -- skeletal animation) T4 determinism + a walk-cycle strip knowledge/nx_articulate.png (6 frames of a walking creature) license_tier: ORIGINAL expect_exit: 0

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_itrig.nx nx_png.nx nx_creaturegen.nx nx_articulate_gate.nx

imports: nx_syscalls.nxnx_itrig.nxnx_png.nxnx_creaturegen.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main hw sys_write sys_mmap cg_fk_leg it_cos4096 it_sin4096 it_sin4096 ↻ d3 pn sys_mmap ↻ sys_write ↻ as_h creaturegen_build_posed cg_next cg_range cg_next ↻ as_ellip as_fuzz_last as_caps cg_leg_posed cg_fk_leg ↻ as_caps ↻ as_fuzz_last ↻ as_ellip ↻ as_color_last as_feature_last anatstack_render it_sin4096 ↻ it_cos4096 ↻ as_isqrt anatstack_sdf as_part_sdf as_isqrt ↻ as_min as_clamp as_min ↻ as_noise3 as_h3 as_smin

structs

none

consts

19const YAW: i64 = 6434 // ~90deg side view: leg swing (fore/aft in Z) is visible
20const THA: i64 = 1500 // thigh swing amplitude (it4096)
21const SHA: i64 = 1100 // shin bend amplitude

functions

14func hw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 1: main calls 1: sys_write
15func pn(v: i64) -> i64 { let b: *u8=sys_mmap(32) as *u8; var x: i64=v; var ng: i64=0; if x<0{ng=1;x=0-x} var i: i64=31; if x==0{b[i]=48 as u8;i=i-1} while x>0{b[i]=(48+x%10) as u8;x=x/10;i=i-1} if ng==1{b[i]=45 as u8;i=i-1} sys_write(1,(b as i64+i+1) as *u8,31-i); return 0 }
called by 1: main calls 2: sys_mmapsys_write
16func d3(a: *i64, ai: i64, b: *i64, bi: i64) -> i64 { let dx: i64=a[ai]-b[bi]; let dy: i64=a[ai+1]-b[bi+1]; let dz: i64=a[ai+2]-b[bi+2]; var s: i64=dx*dx+dy*dy+dz*dz; if s<=0 {return 0} var r: i64=s; var q: i64=(r+1)/2; while q<r {r=q; q=(r+s/r)/2} return r }
called by 1: main
17func L1i(a: *i64, b: *i64, n: i64) -> i64 { var s: i64=0; var i: i64=0; while i<n { var d: i64=(a[i]&255)-(b[i]&255); if d<0{d=0-d} s=s+d; i=i+1 } return s }
called by 1: main
23func main() -> i64