LoginSignup
2
5

More than 5 years have passed since last update.

オブジェクトを面の法線に沿って立たせる

Posted at

上向きベクトルを法線方向に回転させるクオータニオンを作成、transform.rotationに適用する。

Vector3 normal;  // 法線ベクトル
transform.rotation = Quaternion.FromToRotation(Vector3.up, normal);
2
5
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
2
5