我正试图像这样使眼睛的角(这里以一个为例):
FloatBuffer buffer = face.getMeshVertices();
Pose centerPose = face.getCenterPose();
Vector3 cornerLeft = new Vector3(centerPose.tx() + buffer.get(99),centerPose.ty() + buffer.get(100),centerPose.tz() + buffer.get(101));
cornerLeft = camera.worldToScreenPoint(cornerLeft);
我将https://github.com/google-ar/sceneform-android-sdk/issues/563设为红色,但是如此处https://developers.google.com/ar/reference/java/arcore/reference/com/google/ar/core/AugmentedFace#getMeshVertices()所述,给定的顶点相对于中心姿势,这就是为什么我将值添加到中心姿势的顶点。但是结果不正确。我做错了什么?
答案 0 :(得分:0)
解决方案:这不是居中姿势,而是人脸的AugmentedFaceNode,由getMeshVirtices()给出的缓冲区中的值相对于:
if (!faceNodeMap.containsKey(face)) {
AugmentedFaceNode faceNode = new AugmentedFaceNode(face);
faceNode.setParent(scene);
faceNodeMap.put(face, faceNode);
}
...
FloatBuffer buffer = face.getMeshVertices();
Vector3 vectorLeftEyeLeft = new Vector3(buffer.get(33 * 3), buffer.get((33 * 3) + 1), buffer.get((33 * 3) + 2));
Vector3 vectorLeftEyeRight = new Vector3(buffer.get(133 * 3),buffer.get((133 * 3) + 1), buffer.get((133 * 3) + 2));
Node node = new Node();
node.setLocalPosition(new Vector3((vectorLeftEyeLeft.x + vectorLeftEyeRight.x) / 2, (vectorLeftEyeLeft.y + vectorLeftEyeRight.y) / 2, (vectorLeftEyeLeft.z + vectorLeftEyeRight.z) / 2));
node.setParent(faceNodeMap.get(face));
return node.getWorldPosition();