简体   繁体   English

iOS-使用SCNLookAtConstraint似乎无法按我预期的方式工作

[英]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.

相关问题 iOS动画演示层hitTest似乎无法正常工作 - iOS animation presentationLayer hitTest does not seem to work as expected iOS Geofence CLCircularRegion监控。 locationManager:didExitRegion似乎没有按预期工作 - iOS Geofence CLCircularRegion monitoring. locationManager:didExitRegion does not seem to work as expected iOS 图表 moveViewToX 似乎不起作用 - iOS Charts moveViewToX does not seem to work iOS-CAShapeLayer.strokeEnd似乎不起作用 - iOS - CAShapeLayer.strokeEnd does not seem to work 使用SCNLookAtConstraint的SCNText查找错误的方法 - SCNText with SCNLookAtConstraint looking the wrong way isKindOfClass不能像预期的那样工作IOS 7 - isKindOfClass does not work as expected IOS 7 iOS 13:使用新的 NEHotspotConfiguration.init(ssidPrefix: String) 似乎不起作用 - iOS 13: Using the new NEHotspotConfiguration.init(ssidPrefix: String) does not seem to work 数组长度检查似乎不适用于IOS / chrome - array length check does not seem to work on IOS/chrome MultipeerConnectivity 在 iOS 14 上无法按预期工作 - MultipeerConnectivity does not work as expected on iOS 14 ios:旋转和“取消”旋转视图无法按预期工作 - ios : rotating and “un”-rotating views does not work as expected
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM