0
0

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事始め

Posted at

ARKit事始め

UdemyでARKitの講座を受講したので内容をざっくりと振り返って行きます。
随時更新

誰のための記事か

・ARKitを初めて触る方
・ARKitで何ができるのかを知りたい方

開発環境

Xcode 10.0
Swift4

ARKitのアプリテンプレートを作成しよう

Xcodeを起動し、新規アプリケーションを作成します。
「Augmented Reality App」を選択しましょう。
スクリーンショット 2018-10-13 2.05.10.png

初期状態ではscenekitのshipが入っていると思います。
※ shipはart.scnassetsディレクトリにあります。
スクリーンショット 2018-10-13 2.06.11.png

そのまま自身のIPhomeにビルドしてみるとスペースシップが表示されるはずです。
※ 画像はSimulatorです
スクリーンショット 2018-10-13 2.07.32.png

オブジェクトを配置してみよう

続いて様々な形のオブジェクトを配置してみましょう。

まず、先ほどのスペースシップをdeleteキーを押して削除します。
画面右下から様々な形状のオブジェクトをD&Dで配置することができます。
スクリーンショット 2018-10-13 1.32.02.png

コードで生成することもできます。

ViewController.swift
// 20cmのBoxを生成
let box = SCNBox(width: 0.2, height: 0.2, length: 0.2)

// 20cmのPyramidを生成
let pyramid = SCNPyramid(width: 0.2, height: 0.2, length: 0.2)

そのままビルドすればBoxやPyramidが現れます。

壁をトラッキング

...

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?