Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified cockpit/public/torso-frames/torso_000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cockpit/public/torso-frames/torso_001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cockpit/public/torso-frames/torso_002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cockpit/public/torso-frames/torso_003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cockpit/public/torso-frames/torso_004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cockpit/public/torso-frames/torso_005.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cockpit/public/torso-frames/torso_006.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cockpit/public/torso-frames/torso_007.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cockpit/public/torso-frames/torso_008.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cockpit/public/torso-frames/torso_009.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cockpit/public/torso-frames/torso_010.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cockpit/public/torso-frames/torso_011.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cockpit/public/torso-frames/torso_012.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cockpit/public/torso-frames/torso_013.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cockpit/public/torso-frames/torso_014.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cockpit/public/torso-frames/torso_015.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cockpit/public/torso-frames/torso_016.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cockpit/public/torso-frames/torso_017.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cockpit/public/torso-frames/torso_018.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cockpit/public/torso-frames/torso_019.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions cockpit/src/TorsoMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ interface Spl3 {
}

// SPL3 body (22 B): pos 3f | normal 3i8 | rgb 3u8 | opacity u8 | scale u8 | node_row u16.
// Orientation: +90 about X, (x,y,z) -> (x,-z,y) — matches the bake/driver so the
// body stands head-up (BodyParts3D model +Z is superior).
// Orientation: (x,y,z) -> (-x, z, y), a proper rotation that stands the body head-up
// in three.js's Y-up world (BodyParts3D model +Z is superior -> +Y up).
function decodeSpl3(buf: ArrayBuffer): Spl3 {
const dv = new DataView(buf);
const magic = String.fromCharCode(dv.getUint8(0), dv.getUint8(1), dv.getUint8(2), dv.getUint8(3));
Expand All @@ -62,9 +62,9 @@ function decodeSpl3(buf: ArrayBuffer): Spl3 {
for (let i = 0; i < count; i++) {
const b = off + i * 22;
const x = dv.getFloat32(b, true), y = dv.getFloat32(b + 4, true), z = dv.getFloat32(b + 8, true);
positions[i * 3] = x; positions[i * 3 + 1] = -z; positions[i * 3 + 2] = y;
positions[i * 3] = -x; positions[i * 3 + 1] = z; positions[i * 3 + 2] = y;
const nx = dv.getInt8(b + 12) / 127, ny = dv.getInt8(b + 13) / 127, nz = dv.getInt8(b + 14) / 127;
normals[i * 3] = nx; normals[i * 3 + 1] = -nz; normals[i * 3 + 2] = ny;
normals[i * 3] = -nx; normals[i * 3 + 1] = nz; normals[i * 3 + 2] = ny;
colors[i * 3] = dv.getUint8(b + 15) / 255;
colors[i * 3 + 1] = dv.getUint8(b + 16) / 255;
colors[i * 3 + 2] = dv.getUint8(b + 17) / 255;
Expand Down
11 changes: 7 additions & 4 deletions cockpit/src/TorsoMesh.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ interface Mesh {
// | bbox_min 3f | bbox_max 3f
// vertex body vert_count x 21 B: pos 3f | normal 3i8 | rgb 3u8 | opacity u8 | node_row u16
// index body tri_count x 12 B: 3x u32 (global vertex indices)
// Orientation +90 about X, (x,y,z) -> (x,-z,y), so the body stands head-up.
// Orientation (x,y,z) -> (-x, z, y): a proper rotation (det +1, so triangle winding
// and gl_FrontFacing stay correct) that stands the body head-up in three.js's Y-up
// world (model +Z superior -> world +Y up; +Y anterior -> +Z toward viewer). No
// screen-flip — three.js is Y-up, so the rotation lives entirely in the decode.
function decodeSpm1(buf: ArrayBuffer): Mesh {
const dv = new DataView(buf);
const magic = String.fromCharCode(dv.getUint8(0), dv.getUint8(1), dv.getUint8(2), dv.getUint8(3));
Expand All @@ -50,9 +53,9 @@ function decodeSpm1(buf: ArrayBuffer): Mesh {
for (let i = 0; i < vertCount; i++) {
const b = voff + i * 21;
const x = dv.getFloat32(b, true), y = dv.getFloat32(b + 4, true), z = dv.getFloat32(b + 8, true);
positions[i * 3] = x; positions[i * 3 + 1] = -z; positions[i * 3 + 2] = y;
normals[i * 3] = dv.getInt8(b + 12) / 127;
normals[i * 3 + 1] = -dv.getInt8(b + 14) / 127;
positions[i * 3] = -x; positions[i * 3 + 1] = z; positions[i * 3 + 2] = y;
normals[i * 3] = -dv.getInt8(b + 12) / 127;
normals[i * 3 + 1] = dv.getInt8(b + 14) / 127;
normals[i * 3 + 2] = dv.getInt8(b + 13) / 127;
colors[i * 3] = dv.getUint8(b + 15);
colors[i * 3 + 1] = dv.getUint8(b + 16);
Expand Down
9 changes: 5 additions & 4 deletions cockpit/src/TorsoSplat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,12 @@ function decodeSpl3(buf: ArrayBuffer): Spl3 {
const scale = new Float32Array(count);
for (let i = 0; i < count; i++) {
const b = off + i * 22;
// upright: +90 about X, (x,y,z) -> (x,-z,y) (matches bake/driver); normals too.
// upright: (x,y,z) -> (-x, z, y), a proper rotation that stands the body head-up
// in three.js's Y-up world (model +Z superior -> +Y up). normals rotate the same way.
const x = dv.getFloat32(b, true), y = dv.getFloat32(b + 4, true), z = dv.getFloat32(b + 8, true);
positions[i * 3] = x; positions[i * 3 + 1] = -z; positions[i * 3 + 2] = y;
normals[i * 3] = dv.getInt8(b + 12) / 127;
normals[i * 3 + 1] = -dv.getInt8(b + 14) / 127;
positions[i * 3] = -x; positions[i * 3 + 1] = z; positions[i * 3 + 2] = y;
normals[i * 3] = -dv.getInt8(b + 12) / 127;
normals[i * 3 + 1] = dv.getInt8(b + 14) / 127;
normals[i * 3 + 2] = dv.getInt8(b + 13) / 127;
colors[i * 3] = dv.getUint8(b + 15);
colors[i * 3 + 1] = dv.getUint8(b + 16);
Expand Down