From dbe366208881e47520e6f72aaeafdd8ead835581 Mon Sep 17 00:00:00 2001 From: crosstyan Date: Thu, 17 Apr 2025 11:55:33 +0800 Subject: [PATCH] Update App.tsx to introduce a new pose data structure for skeleton animation, enhancing the Human3DSkeleton component to accept multiple skeletons. Adjust type definitions and update skeleton instances in the Scene for improved flexibility in pose rendering. --- src/App.tsx | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 7318ac2..be7b974 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -8,12 +8,22 @@ import { useEffect, useRef, useState, JSX } from 'react' // import POSE_3D_ from "./assets/result_ae_01_ae_08.json" import POSE_3D_ from "./assets/temp_result.json" import POSE_3D_MANY_ from "./assets/many_people_all_3d_pose.json" +import POSE_3D_04_02_ from "./assets/res.json" + +// 133, 3 +type PosePoints3D = [number, number, number][] // F, 133, 3 -type SkeletonType = [number, number, number][][] +type AnimePosePoints3D = PosePoints3D[] -const POSE_3D = POSE_3D_ as SkeletonType -const POSE_3D_MANY = POSE_3D_MANY_ as SkeletonType[] // N F 133 3 +interface Skeleton0402 { + "a": PosePoints3D + "b": PosePoints3D +} + +const POSE_3D = POSE_3D_ as AnimePosePoints3D +const POSE_3D_MANY = POSE_3D_MANY_ as AnimePosePoints3D[] // N F 133 3 +const POSE_3D_04_02 = POSE_3D_04_02_ as Skeleton0402 const THREE_ADDONS = { FontLoader, @@ -261,7 +271,7 @@ const Scene = () => { } interface Human3DSkeletonProps { - skeleton: SkeletonType + skeleton: AnimePosePoints3D startFrame?: number jointRadius?: number boneRadius?: number @@ -409,8 +419,12 @@ const Scene = () => { // const skeletons = [, // // ] + // const skeletons = [ + // , + // ] const skeletons = [ - , + , + , ] const cameras = Object.entries(CAMERA_EXTRINSIC_MATRIX_MAP).map(([key, value]) => {