Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Cookbook page #3415

Open
abernier opened this issue Dec 15, 2024 · 1 comment
Open

docs: Cookbook page #3415

abernier opened this issue Dec 15, 2024 · 1 comment
Assignees

Comments

@abernier
Copy link
Member

abernier commented Dec 15, 2024

Add a docs/cookbook.mdx page with different recipes:

How to convert a fiber Vector3 into a THREE.Vector3

Fiber has a Vector3 type which can be:

  • new THREE.Vector3(2,2,2) -- a THREE.Vector3
  • [2,2,2] -- a 3-tuple
  • 2 -- a number
function toThreeVec3(v: Vector3) {
  return v instanceof THREE.Vector3 ? v : new THREE.Vector3(...(typeof v === 'number' ? [v, v, v] : v))
}

Using <Suspense> with suspend-react

TODO: but can get inspired from https://discord.com/channels/740090768164651008/740094974187798609/1306911036716355594

@abernier abernier self-assigned this Dec 15, 2024
@krispya
Copy link
Member

krispya commented Dec 16, 2024

It's an interesting idea. I also noticed it isn't so obvious right now how to do things like extend R3F for custom classes with types. It makes me think we need to organize the docs better in general.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants