【发布时间】:2017-05-03 05:57:44
【问题描述】:
已经有一个问题,它有一个答案here,但是它并没有按我预期的方式工作。
# Assume my radius is 1 for simplicity
x = cos(s) * sin(t)
y = sin(s) * sin(t)
z = cos(t)
当t=0时,不管我的s,
(x,y,z)=(0,0,1)
# Since sin 0 = 0 on x
# and y and z is independent of s
我的世界是这样的
但实际上当 s 增加时,球体上的点会发生变化,不会停留在 (0,0,1)。例如。如果我的 s=(-45)deg 和 t=0,球体上的点应该是 (0,0.707,0.707) 对吧?
更新:这是我需要的:
(s,t) | (x,y,z)
---------------
(0,0) | (0,0,1)
(45,0) | (.707,0,0.707)
(90,0) | (1,0,0)
(180,0) | (0,0,-1)
(270,0) | (-1,0,0)
(0,-45) | (0,0.707,0.707)
(0,45) | (0,-0.707,0.707)
但我没有从上面的方程式中得到这些结果......!我该怎么办?
【问题讨论】:
-
统一用户注意事项:s=
transform.eulerAngles.y和 t=transform.eulerAngles.x
标签: math unity3d mapping virtual-reality