Conversation
|
This is amazing! |
toji
left a comment
There was a problem hiding this comment.
As you said, this is just an FYI for now but I've got some comments for you anyway!
proposals/body-tracking.html
Outdated
| const material = new THREE.MeshLambertMaterial(); | ||
|
|
||
| spheres = new THREE.InstancedMesh( geometry, material, body.size ); | ||
| spheres.translateZ( -1 ).setRotationFromMatrix (new THREE.Matrix4().makeRotationY(Math.PI)); |
There was a problem hiding this comment.
I'm not clear on how this works, and it's probably worth a comment for developers sake.
My guess is that this is a transform applied to the entire collection of instances spheres as a sort of root transform? If so, how does this result in the behavior in the video you linked, which appears to mirror your movements rather than show them rotated 180? (Although to be fair you never really moved your hands one at a time, so it's hard to tell. Full body movement suggests a mirror instead of a rotation, though.)
In any case, more comments throughout would be welcome!
proposals/body-tracking.html
Outdated
| matrix.identity(); | ||
| } | ||
|
|
||
| matrix.setPosition( -position.x, position.y, position.z ); |
There was a problem hiding this comment.
Oh, and I see that the positions are being inverted in X here too? Is THAT what causes the mirroring effect?
c591ea1 to
795d0cc
Compare
| if (!part.jointName.includes("hand")) { | ||
| scaledMatrix.makeScale(3, 3, 3); | ||
| } else { | ||
| - scaledMatrix.identity(); |
There was a problem hiding this comment.
What's the - here? Typo or leftover from a merge? Does this code run?
FYI @toji
example video:
https://github.com/immersive-web/webxr-samples/assets/1513308/6e5227c6-d451-4846-a0a2-6607bfcce627