1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ARKit, SceneKit個人的まとめ - 基礎編

Last updated at Posted at 2019-10-20

シーンとノード

boundingBox, boundingSphere

boundingBox

図形や立体を最小で囲む図形の箱(StoryboardのTransformsでも見れる)

let (min, max) = hogeNode.boundingBox
//hogeNodeの幅を計算
let width = CGFloat(max.x - min.x)
//元の大きさ(boundingBox)の1/10にスケールする
let magnification = 0.1 * 1 / w
hogeNode.scale = SCNVector3(magnification, magnification, magnification)

boundingSphere

図形が変わっただけで考え方は同じ

->minが左下座標, maxが右上座標
boundingBox - SCNBoundingVolume | Apple Developer Documentation
->centerが中心座標, radiusが(対象がギリギリで全部おさまる)半径
boundingSphere - SCNBoundingVolume | Apple Developer Documentation

アニメーション

アニメーションはcoreAnimatonなど色々あるが
sceneKitではSCNActionを使うのが一般的らしい
確かにシンプルで使いやすい感じ。

他参考

iOS で SceneKit を試す(Swift 3) その16 - Scene Editor の Node Inspector - Apple Engine
->シリーズ90まであるので大変だけどこれ一通りやってしまえばSceneKitは攻略したもんだと思う、、、気がする

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?