LoginSignup
0
0

More than 3 years have passed since last update.

ARオブジェクトを常にカメラの方向を向いた状態で配置する

Posted at

できるもの

配置する場所に依存することなく、オブジェクトは常に立方体の側面が見えていない状態で生成されます。
Regardless of where it is placed, the object is always created with the sides of the cube not visible.
IMG_8FA76380F0EA-1.jpeg IMG_F9BBA852BDCA-1.jpeg

前提となる知識

  • ワールド座標は起動時に生成される
  • SCNNode.eulerAngles = SCNVector()で回転を行うことができる

実装方法

SCNNodeを作成する関数の中で、nodeに対して回転を行います。

if let camera = self.sceneView.pointOfView {
            boxNode.eulerAngles = SCNVector3(0,camera.eulerAngles.y,0)
        }

参考にしたサイト

[iOS11][ARKit] オブジェクトの位置と回転「常にこっちを向いている怪獣」

0
0
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
0
0