Skip to content

Facemesh v2#1437

Merged
abernier merged 4 commits intomasterfrom
abernier/facemesh-v2
May 10, 2023
Merged

Facemesh v2#1437
abernier merged 4 commits intomasterfrom
abernier/facemesh-v2

Conversation

@abernier
Copy link
Copy Markdown
Member

@abernier abernier commented May 9, 2023

Note Merged
see <Facemesh> doc

Why / What

<Facemesh> is now looking in some direction:

image

We can for example gets the direction with the ref-api:

meshRef.current.localToWorld(new THREE.Vector3(0, 0, -1))
facemeshv2.mov

Checklist

  • Documentation updated
  • Storybook entry added
  • Ready to be merged

@vercel
Copy link
Copy Markdown

vercel Bot commented May 9, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
drei ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 10, 2023 6:52pm

@codesandbox-ci
Copy link
Copy Markdown

codesandbox-ci Bot commented May 9, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 7531949:

Sandbox Source
musing-burnell-1urlby Configuration
Ground reflections and video textures Configuration
arc-x-pmndrs-colors Configuration

@abernier abernier force-pushed the abernier/facemesh-v2 branch from cbe751f to cf89b6e Compare May 9, 2023 17:01
@abernier abernier changed the title feat(Facemesh): it now looks in the same direction as the face Facemesh v2 May 9, 2023
@abernier abernier marked this pull request as ready for review May 9, 2023 23:53
Copy link
Copy Markdown
Member

@krispya krispya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to stick all these vectors into a useState callback. But also, instead of putting each in their own useState callback you can put them in one like this:

const [store] = useState(() => ({ vecA: new Vector3(), vecB: new Vector3(), vecC: new Vector3() }))
store.vecA.set(1,1,1)

Comment thread src/core/Facemesh.tsx Outdated
Comment thread src/core/Facemesh.tsx Outdated
Comment thread src/core/Facemesh.tsx Outdated
Comment thread src/core/Facemesh.tsx Outdated
Comment thread src/core/Facemesh.tsx Outdated
Comment thread src/core/Facemesh.tsx Outdated
@abernier
Copy link
Copy Markdown
Member Author

abernier commented May 10, 2023

It's better to stick all these vectors into a useState callback. But also, instead of putting each in their own useState callback you can put them in one like this:

const [store] = useState(() => ({ vecA: new Vector3(), vecB: new Vector3(), vecC: new Vector3() }))
store.vecA.set(1,1,1)

I leave it with multiple states for now, but great technique to "pack" them together ;)

@abernier abernier merged commit f8fa46c into master May 10, 2023
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 9.67.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@CodyJasonBennett CodyJasonBennett deleted the abernier/facemesh-v2 branch May 10, 2023 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants