Files
breeze/tests/sun_salutation_artwork_behavior.zi
waozi 4276dbbf75 Sun Salutation drawn like the studio's 3D woman: a seat under a draped top
A three.js body lab (design/tai-chi/sun-salutation.html, tools/sun-salutation.mjs)
plays the app's exact Sun Salutation motion, exported by
render-sun-salutation-live.py --motion, on the studio's skinned 3D woman in
the app's look. There the long top drapes over the hips and a seat
ellipsoid sits inside it, which looks natural in every pose. The app now
draws her the same way: the slimmer top at the Jade woman's length over one
seat ellipsoid on the pelvis, in place of separate buttock shapes.
2026-10-23 17:46:18 -03:00

53 lines
2.2 KiB
Ziran

// Both Sun Salutation figures paint every pose of both rounds soundly.
#import "math"
#import, file "../apps/practice/sun_salutation_artwork.zi";
#import, file "../apps/practice/workout_moves.zi";
#import, file "../src/practices/sun_salutation/sun_salutation_pose.zi";
#import, file "../src/practices/sun_salutation/sun_salutation_rules.zi";
#import, file "../src/practices/tai_chi/tai_chi_flat.zi";
#import, file "../src/practices/tai_chi/tai_chi_math.zi";
artwork_frame: TaiChiFlatFrame;
#program_export
Answer :: () -> s32 {
// The Sun Salutation woman is the Jade woman of Tai Chi and the workout:
// the same clothes and hair, cut slimmer.
original := TaiChiFlatLookNamed("jadeWoman")
chosen := SunSalutationWomanLook()
if chosen.top != original.top || chosen.pants != original.pants || chosen.cuff != original.cuff ||
chosen.hair_style != original.hair_style || chosen.head_scale != original.head_scale {
return 501
}
if !(chosen.limbs < original.limbs && chosen.jacket[7][2] < original.jacket[7][2] && chosen.seat[0] > 0.0) {
return 502
}
rig := WorkoutRig()
state := SalutationStart(SunSalutationPracticeState.{})
for character: cast(s32)0..1 {
state.character = character
for round: cast(s32)0..1 {
state.repetition = round
for step: cast(s32)0..11 {
state.step = step
for sample: cast(s32)0..12 {
state.step_ticks = sample * 30
pose := SunSalutationPoseAt(state, *rig)
SunSalutationPaintPose(*artwork_frame, state.character, pose, SunSalutationViewAt(state), 1536.0, 1024.0)
if artwork_frame.op_count < 30 || artwork_frame.op_count >= TAI_CHI_FLAT_OP_CAPACITY ||
artwork_frame.point_count >= TAI_CHI_FLAT_POINT_CAPACITY {
return 503
}
for index: cast(s32)0..artwork_frame.point_count - 1 {
point := artwork_frame.points[index]
if !Finite64(point.x) || !Finite64(point.y) {
return 507
}
}
}
}
}
}
return 42
}