Capítulo 261 de 988
<ThreeCanvas>A wrapper for React Three Fiber's <Canvas /> which synchronizes with Remotions useCurrentFrame().
<Sequence><ThreeCanvas>const ThreeBasic: React.FC = () => {
const frame = useCurrentFrame();
const {width, height} = useVideoConfig();
return (
<ThreeCanvas
orthographic={false}
width={width}
height={height}
style={{
backgroundColor: 'white',
}}
camera={{fov: 75, position: [0, 0, 470]}}
>
<ambientLight intensity={0.15} />
<pointLight args={[undefined, 0.4]} position={[200, 200, 0]} />
<mesh position={[0, 0, 0]} rotation={[frame * 0.06 * 0.5, frame * 0.07 * 0.5, frame * 0.08 * 0.5]} scale={interpolate(Math.sin(frame / 10), [-1, 1], [0.8, 1.2])}>
<boxGeometry args={[100, 100, 100]} />
<meshStandardMaterial color={[Math.sin(frame * 0.12) * 0.5 + 0.5, Math.cos(frame * 0.11) * 0.5 + 0.5, Math.sin(frame * 0.08) * 0.5 + 0.5]} />
</mesh>
</ThreeCanvas>
);
};
export default ThreeBasic;
<ThreeCanvas> from the official docs.<ThreeCanvas>.<ThreeCanvas>.<sequence> when working with <ThreeCanvas>.<threecanvas> when working with <ThreeCanvas>.<ThreeCanvas>.