[英]IOS - using SCNLookAtConstraint does not seem to work the way I expected
I am learning SceneKit and trying to get the tip of a cone to point at the another node (a capsule) that is bouncing. 我正在学习SceneKit,并尝试使圆锥体的尖端指向正在反弹的另一个节点(胶囊)。 Regardless of using the .orient on the cone, as soon as the SCNLookAtConstraint call gets made it re-orients the cone to the standard upright position so that the cone tip point straight up along the Y axis again and rock left and right as opposed to pointing its tip to the moving capsule which is to the rightof the cone. 不管在圆锥体上使用.orient为何,只要调用SCNLookAtConstraint即可将圆锥体重新定向到标准直立位置,以便圆锥体尖端再次沿Y轴垂直指向,并相对于将其尖端指向圆锥体右侧的移动胶囊。 I tried changing the .pivot of the cone as well but that just seems to change the anchor point of the pivot but does not change the orientation of the cone.I need something like a SCNLookAtConstraint that indicates what point of the cone looks at the capsule? 我也尝试过改变圆锥体的.pivot,但这似乎只是改变了枢轴的锚点,但没有改变圆锥体的方向。我需要像SCNLookAtConstraint这样的东西来指示圆锥体的哪个点看向胶囊?
Thanks 谢谢
the pivot
property is the way to go. pivot
属性是要走的路。 It allows you to change the anchor point, but also its orientation since its a transform. 它允许您更改锚点,但也可以更改它的方向,因为它是一个转换。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.