SCNNode is not appearing in correct position

别来无恙 提交于 2020-07-10 05:59:08

问题


I downloaded the wall2.obj file from Google Blocks and then I used Blender to change the extension to .dae the wall node is not appearing where it should be.

Where the wall node placed vs. where it should be placed:


回答1:


It's a model's pivot point issue

In Blender change a pivot point's position to the desired one – move pivot point to the center of your model, and then at its bottom. If your model consists of several independent parts, group all parts and use just one composite pivot point.

Or you can use simdPivot instance property in you code to move a pivot programmatically:

brickWallNode.simdPivot.columns.3.x = -0.5



回答2:


An alternate solution for Xcode users is creating a parent node for that object and then move the object node relative to the parent node you have created.



来源:https://stackoverflow.com/questions/61984938/scnnode-is-not-appearing-in-correct-position

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!