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

Facemesh v2 #1437

Merged
merged 4 commits into from
May 10, 2023
Merged

Facemesh v2 #1437

merged 4 commits into from
May 10, 2023

Conversation

abernier
Copy link
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

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

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
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)

src/core/Facemesh.tsx Outdated Show resolved Hide resolved
src/core/Facemesh.tsx Outdated Show resolved Hide resolved
src/core/Facemesh.tsx Outdated Show resolved Hide resolved
src/core/Facemesh.tsx Outdated Show resolved Hide resolved
src/core/Facemesh.tsx Outdated Show resolved Hide resolved
src/core/Facemesh.tsx Outdated Show resolved Hide resolved
@abernier
Copy link
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

🎉 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