LoginSignup
5
7

More than 5 years have passed since last update.

球座標の計算

Posted at

Three.jsで重宝しそうな球座標の計算式は以下。

x = Math.cos(rad) * Math.cos(rad2) * r;
y = Math.cos(rad) * Math.sin(rad2) * r;
z = Math.sin(rad) * r;

以下デモ。
http://codepen.io/ykob/details/bdEQdv/

以下のページを参考にしました。
http://fnorio.com/0098spherical_trigonometry1/spherical_trigonometry1.html

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