Spaces:
Running
Running
Download src/video/state.ts from Ethscriptions/mx: direct link, hf CLI and curl.
- Browser
- Download file 721 Bytes
-
https://huggingface.co/spaces/Ethscriptions/mx/resolve/main/src/video/state.ts
- Command line
-
hf download hf://spaces/Ethscriptions/mx/src/video/state.ts
-
curl -L -o state.ts https://huggingface.co/spaces/Ethscriptions/mx/resolve/main/src/video/state.ts
721 Bytes
| import { POSE, type SceneState } from './model' | |
| import type { V3 } from './math' | |
| export function baseState(over: Partial<SceneState> = {}): SceneState { | |
| return { | |
| cam: { pos: [0, 0.2, 5], target: [0, 0.2, 0], fov: 35 }, | |
| arm: { pos: [0, 0, 0], rot: [0, 0.6, 0] }, | |
| pose: [...POSE.rest], | |
| skin: 1, xray: 0, bone: 0, tendon: 0, sheath: 0, thick: 0, friction: 0, pain: 0, | |
| props: {}, | |
| time: 0, | |
| ...over, | |
| } | |
| } | |
| /** camera orbiting helper: spherical around target */ | |
| export function orbit(target: V3, dist: number, yaw: number, pitch: number): V3 { | |
| return [target[0] + dist * Math.sin(yaw) * Math.cos(pitch), target[1] + dist * Math.sin(pitch), target[2] + dist * Math.cos(yaw) * Math.cos(pitch)] | |
| } | |