three.js Spherical

2023-02-16 17:47 更新

一個點的spherical coordinates(球坐標)。

構造函數(shù)

Spherical( radius : Float, phi : Float, theta : Float )

radius - 半徑值,或者說從該點到原點的 Euclidean distance(歐幾里得距離,即直線距離)。默認值為1.0
phi - 與 y (up) 軸的極角(以弧度為單位)。 默認值為 0
theta - 繞 y (up) 軸的赤道角(方位角)(以弧度為單位)。 默認值為 0。

極角(phi)位于正 y 軸和負 y 軸上。赤道角(方位角)(theta)從正 z 開始。

屬性

.radius : Float

.phi : Float

.theta : Float

方法

.clone () : Spherical

返回一個新的球坐標,新的球坐標與該球坐標具有相同的 radius、phi和theta。

.copy ( s : Spherical ) : this

復制所傳入的球坐標的radius、 phi 和theta屬性到該球坐標中。

.makeSafe () : this

將極角 phi 的值限制在0.000001 和 π - 0.000001 之間。

.set ( radius : Float, phi : Float, theta : Float ) : this

設置球坐標中radius、phi 和 theta 屬性的值。

.setFromVector3 ( vec3 : Vector3 ) : this

從Vector3中設置球坐標的radius、phi和theta值。

.setFromCartesianCoords ( x : Float, y : Float, z : Float ) : this

從笛卡爾坐標系中設置球坐標的radius、phi和theta值。

源代碼

src/math/Spherical.js


以上內容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號