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 3 years have passed since last update.

SCNPlaneに画像を貼り付ける

Posted at

##SCNPlaneについて

SCNPlaneはデフォルトでx軸に並行な向きで作成されます。ARなどで使うときはwidth=0.05くらいがいいかと思われます。
参考公式リファレンス

スクリーンショット 2020-09-05 15.26.36.jpg

##ソースコード

var plane1 = SCNNode()

self.plane1.geometry?.firstMaterial?.diffuse.contents = UIImage(named: "rect1")
self.plane1.eulerAngles = SCNVector3(-90.degreeToRadians,0,0)

水平面に並行にするためには90度回転させます。
この時90度ではなく-90度としているのは,SCNPlaneはy>0の向きに画像が貼り付けられるからです。

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?