13
13

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.

モデルの向き(角度)から単位ベクトルを求める

Last updated at Posted at 2014-05-05

y軸に対するモデルの回転角度から、x, z 平面での単位ベクトルを求める

double radian = transform.eulerAngles.y * (Math.PI / 180); 
float momentX = (float)(Math.Sin (radian) * 0.1);
float momentZ = (float)(Math.Cos (radian) * 0.1);
Vector3 momentAddition = new Vector3(momentX, 0, momentZ);

なんて、ことしなくてもtransform.forwardで取得することができた...

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?