简体   繁体   English

如何在 SceneKit 中将这个 model 居中

[英]How to center this model in SceneKit

Imported a tiger model into SceneKit, but it is off center?将老虎 model 导入到 SceneKit 中,但它偏离了中心? Is this something I can fix?这是我可以解决的问题吗? The green/red/blue arrows should be under the model?绿色/红色/蓝色箭头应该在 model 下面?

在此处输入图像描述

To reposition model's pivot point in SceneKit, use the following code:要在 SceneKit 中重新定位模型的 pivot 点,请使用以下代码:

node.simdPivot.columns.3.x
node.simdPivot.columns.3.y
node.simdPivot.columns.3.z

If you wanna know more about 4x4 matrices, read this post .如果您想了解更多关于 4x4 矩阵的信息,请阅读这篇文章

you can use yourEntity.position = SIMD3(x: 0, y: 0, z: 0)你可以使用yourEntity.position = SIMD3(x: 0, y: 0, z: 0)

or set the position with editor或者用编辑器设置 position

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM