nx_scene3d.nx
buildroot/runtime/nx_scene3d.nx
about
nx_scene3d.nx -- reusable 3D scene primitives: integer trig (Bhaskara Q10) + rotate + perspective project +
per-face Lambert-shaded, depth-sorted cube. Extracted from the proven cube gates so the native game window and
the gates share ONE implementation of the 3D math (no duplicate sprawl). Composes nx_depth_tri. Pure integer,
deterministic, no gcc/GL. license_tier: ORIGINAL
dependencies 3 imports · 2 importers
imports: nx_syscalls.nxnx_image.nxnx_depth_tri.nx
imported by: nishi_game.nxnx_scene3d_gate.nx
structs
| 21 | struct Cube3D |
consts
| 9 | const SC_AMB: i64 = 105 // ambient floor (~41%) |
| 28 | const CUBE3D_BYTES: i64 = 128 |
functions
| 11 | func sc_isin(deg: i64) -> i64 |
| 19 | func sc_icos(deg: i64) -> i64 { return sc_isin(deg + 90) } |
| 30 | func sc_cube_new(S: i64, focal: i64, dist: i64) -> *Cube3D |
| 58 | func sc_ndotl(rx: *i64, ry: *i64, rz: *i64, ia: i64, ib: i64, ic: i64, id: i64) -> i64 called by 1: sc_face |
| 70 | func sc_shade(ndl: i64, nlmax: i64) -> i64 called by 1: sc_face |
| 76 | func sc_face(c: *Cube3D, fb: *Image, zb: *i64, ia: i64, ib: i64, ic: i64, id: i64, r: i64, g: i64, b: i64, nlmax: i64) -> i64 |
| 93 | func sc_cube_draw(c: *Cube3D, fb: *Image, zb: *i64, cx: i64, cy: i64, ay: i64, ax: i64) -> i64 |