Skip to content

Commit

Permalink
Merge pull request #2 from AgoraIO-Community/guide
Browse files Browse the repository at this point in the history
Guide
  • Loading branch information
digitallysavvy authored Jun 18, 2024
2 parents 1257200 + 6af1bb7 commit c9431f2
Show file tree
Hide file tree
Showing 9 changed files with 395 additions and 6 deletions.
385 changes: 385 additions & 0 deletions docs/GUIDE.md

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions docs/credits.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Asset Credits
Avatar: [ReadyPlayer.me](https://readyplayer.me)
HDR: [Poly Haven: Hanger Interior](https://polyhaven.com/a/hangar_interior)
HDR: [Poly Haven: Metro Noord](https://polyhaven.com/a/metro_noord)
Binary file added docs/images/Agora-to-video_element.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/Intro-Demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/Screenshot-complete.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/Screenshot_RPM_URL.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/Working-Demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/canvas-to-agora-video-track.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ const handleJoin = async (event) => {
initPredictLoop(faceLandmarker, video) // start face landmarks prediction loop
})

// list of the mouth blendshapes
const mouthBlendshapes = [
// list of the mouth blend shapes
const mouthBlendShapes = [
'mouthSmile_L', 'mouthSmile_R', 'mouthFrown_L','mouthFrown_R',
'mouthOpen', 'mouthPucker','mouthWide','mouthShrugUpper','mouthShrugLower',
]
Expand All @@ -144,13 +144,13 @@ const handleJoin = async (event) => {
nodes.Head.rotation.set(headRotation.x, headRotation.y, headRotation.z)
nodes.Neck.rotation.set(headRotation.x/2, headRotation.y/2, headRotation.z/2)
nodes.Spine1.rotation.set(headRotation.x/3, headRotation.y/3, headRotation.z/3)
// loop through the blendshapes
// loop through the blend shapes
blendShapes.forEach(blendShape => {
const headMesh = nodes.Wolf3D_Avatar
const blendShapeIndex = headMesh.morphTargetDictionary[blendShape.categoryName]
if (blendShapeIndex >= 0) {
// exagerate the score for the mouth blendshapes
if (mouthBlendshapes.includes[blendShape.categoryName] && blendShape.score > threshold.min && blendShape.score < threshold.max ) {
// exaggerate the score for the mouth blend shapes
if (mouthBlendShapes.includes[blendShape.categoryName] && blendShape.score > threshold.min && blendShape.score < threshold.max ) {
blendShape.score *= exagerationMultiplier
}
headMesh.morphTargetInfluences[blendShapeIndex] = blendShape.score
Expand Down Expand Up @@ -233,7 +233,7 @@ const initPredictLoop = (faceLandmarker, video) => {
const matrix = new THREE.Matrix4().fromArray(faceMatrix[0].data)
headRotation = new THREE.Euler().setFromRotationMatrix(matrix)
}
// get blendshape predictions for face 1
// get blend shape predictions for face 1
const blendShapePredictions = result.faceBlendshapes
if (blendShapePredictions && blendShapePredictions.length > 0){
blendShapes = blendShapePredictions[0].categories
Expand Down

0 comments on commit c9431f2

Please sign in to comment.