pointOfView 节点基本上是活动相机。因此,您可以创建一个 SCNNode 来保存面部(通过创建其 SCNGeometry),根据需要定位节点,然后将该节点添加为相机的子节点。然后,如果您在相机周围移动,面部节点将跟随。
根据您有限的描述,另一种可能更适合的方法是使用 spritekit 覆盖场景(因为它只是一张脸)。
编辑:根据您在下面的评论,请找到包含以下代码(它在 OBJ C 中,但它完成了您似乎正在寻找的数学运算)。我用它来做类似的事情,与法线对齐(下面的轴变量是输入法线)。生成的矩阵 rotMat 应用于图像中的坐标应该可以解决问题。
// Find a vector in the plane
GLKVector3 tangent0 = [self crossVector:axis : GLKVector3Make(1, 0, 0)];
if ([self dotVector:tangent0 : tangent0] < 0.001) {
tangent0 = [self crossVector: axis: GLKVector3Make(0, 1, 0)];
}
tangent0 = [self normalizeVector: tangent0];
// Find another vector in the plane
GLKVector3 tangent1 = [self crossVector: axis: tangent0];
tangent1 = [self normalizeVector: tangent1];
//construct a 4x4 matrix using tangents and initial axis
GLKVector4 tangent0GLK4 = GLKVector4Make(tangent0.x, tangent0.y, tangent0.z, 0);
GLKVector4 tangent1GLK4 = GLKVector4Make(tangent1.x, tangent1.y, tangent1.z, 0);
GLKVector4 axisGLK4 = GLKVector4Make(axis.x, axis.y, axis.z, 0);
GLKMatrix4 rotMat = GLKMatrix4MakeWithColumns(tangent0GLK4, tangent1GLK4, axisGLK4, GLKVector4Make(0, 0, 0, 1));