View the figure from a slight elevation and refine the leg-machine rollers
The default camera pitches down 10 degrees, so the floor reads as a plane (drawn as a rectangle) and near/far contacts straddle it. Elevation is pure presentation - IK pins solve in the flat authored view and the posed body tilts, the same pattern as the orbit, so authored canvas targets never go out of reach. The leg-extension roller moves up onto the shin above the ankle and the leg-curl roller tucks under the heel. Fixtures and reference test values regenerated for the pitched camera. Claude-Session: https://claude.ai/code/session_01LEoff8bXGBS83tK1c55Mf7
This commit is contained in:
@@ -231,12 +231,15 @@ def fk_limb(kind, attach, joint, lower, ankle, prof, parent, sigma):
|
||||
return [attach, knee, ank, toe]
|
||||
|
||||
|
||||
def pose(nf, prof, cam_yaw):
|
||||
def pose(nf, prof, cam_yaw, cam_pitch=0.0):
|
||||
"""FK a normalized frame into view space (x right, y up, z toward the
|
||||
camera; origin at the root anchor). Returns points, parent frames (for
|
||||
IK inversion), the nose direction, and the lateral depth factor k."""
|
||||
camera; origin at the root anchor). `cam_pitch` tilts the viewpoint down
|
||||
from slightly above (the scene rotates about the root). Returns points,
|
||||
parent frames (for IK inversion), the nose direction, and the lateral
|
||||
depth factor k."""
|
||||
r = nf["root"]
|
||||
f_root = chain(rot_y(-cam_yaw), rot_y(r["yaw"]), rot_z(-r["pitch"]), rot_x(r["roll"]))
|
||||
f_root = chain(rot_x(cam_pitch), rot_y(-cam_yaw),
|
||||
rot_y(r["yaw"]), rot_z(-r["pitch"]), rot_x(r["roll"]))
|
||||
origin = (0.0, 0.0, 0.0)
|
||||
|
||||
s1, s2 = nf["spine"]
|
||||
@@ -328,12 +331,12 @@ def view_from_canvas(pt, anchor, depth):
|
||||
return (pt[0] - anchor[0], anchor[1] - pt[1], depth)
|
||||
|
||||
|
||||
def resolve(nf, prof, cam_yaw):
|
||||
def resolve(nf, prof, cam_yaw, cam_pitch=0.0):
|
||||
"""Pose a normalized frame and apply pins: for each pinned limb, solve IK
|
||||
against the canvas target (at the limb's FK depth), write the solved
|
||||
anatomical angles back into the frame, and re-pose. Returns
|
||||
(frame with IK-resolved angles, pose dict)."""
|
||||
p = pose(nf, prof, cam_yaw)
|
||||
p = pose(nf, prof, cam_yaw, cam_pitch)
|
||||
anchor = nf["root"]["pos"]
|
||||
solved = False
|
||||
for limb, (attach_key, sigma, pin) in LIMBS.items():
|
||||
@@ -356,7 +359,7 @@ def resolve(nf, prof, cam_yaw):
|
||||
nf["hip_" + side], nf["knee_" + side] = upper, lower
|
||||
solved = True
|
||||
if solved:
|
||||
p = pose(nf, prof, cam_yaw)
|
||||
p = pose(nf, prof, cam_yaw, cam_pitch)
|
||||
return nf, p
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user