🎥 Make videos programmatically with React
add some docs
Jonny Burger800375ffd7e7
diff --git a/packages/docs/docs/three-canvas.md b/packages/docs/docs/three-canvas.mdindex e1277ad08b..7d63affe7c 100644--- a/packages/docs/docs/three-canvas.md+++ b/packages/docs/docs/three-canvas.md@@ -3,4 +3,55 @@ id: three-canvastitle: <ThreeCanvas />----Doc for Three Canvas+A wrapper for [React Three Fiber](https://github.com/pmndrs/react-three-fiber)'s `<Canvas />` which synchronizes with Remotions [`useCurrentFrame()`](/docs/use-current-frame).++Since React Three Fiber is a custom renderer, normally the React contexts that surround it don't work inside. This would normally break the usage of it in Remotion, but this component wraps the contexts so you can write your markup as expected.++Instead of using React Three Fibers `useFrame` API, you can (and must) write your animations fully declaratively using Remotions `useCurrentFrame` API. This will ensure that you can scrub back and forth in the timeline and pause the animation.++## Example++A spinning, color changing, scaling cube. This example can also be found in the `examples` folder of the Remotion repo.++```tsx+import React from 'react';+import {interpolate, useCurrentFrame} from 'remotion';+import {ThreeCanvas} from '@remotion/three';++const ThreeBasic: React.FC = () => {+ const frame = useCurrentFrame();++ return (+ <div style={{display: 'flex', width: '100%', backgroundColor: 'white'}}>+ <ThreeCanvas+ orthographic={false}+ 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>+ </div>+ );+};++export default ThreeBasic;+```diff --git a/packages/docs/docs/three-overview.md b/packages/docs/docs/three-overview.mddeleted file mode 100644index 2cd116ecce..0000000000--- a/packages/docs/docs/three-overview.md+++ /dev/null@@ -1,4 +0,0 @@-----id: three-overview-title: Overview----diff --git a/packages/docs/docs/three.md b/packages/docs/docs/three.mdnew file mode 100644index 0000000000..60adb86f79--- /dev/null+++ b/packages/docs/docs/three.md@@ -0,0 +1,8 @@+---+id: three+title: "@remotion/three"+sidebar_label: Overview+---++This package provides helper functions for using [React Three Fiber](https://github.com/pmndrs/react-three-fiber) in Remotion.+Using this package, you can leverage Three.JS and WebGL to create stunning 3D animations and apply filters to videos.diff --git a/packages/docs/sidebars.js b/packages/docs/sidebars.jsindex 909bef99b2..8ba5a37a4b 100644--- a/packages/docs/sidebars.js+++ b/packages/docs/sidebars.js@@ -75,7 +75,7 @@ module.exports = {{type: "category",label: "API - @remotion/three",- items: ["three-overview", "three-canvas"],+ items: ["three", "three-canvas", "three-video"],},"2-0-migration","license",