我试着用绘图绘制3D图形,需要调整相机的位置。我发现有两种方法可以做到:要么使用Scene
对象的camera
属性,要么使用cameraposition
属性。我对两者都有问题,但这个问题与cameraposition
有关:我不知道它是什么意思。在
docs上写着:
| cameraposition [required=False] (value=camera position list or 1d numpy
| array):
| Sets the camera position with respect to the scene. The first entry
| (a list or 1d numpy array of length 4) sets the angular position of
| the camera. The second entry (a list or 1d numpy array of length 3)
| sets the (x,y,z) translation of the camera. The third entry (a
| scalar) sets zoom of the camera.
|
| Examples:
| [[0.2, 0.5, 0.1, 0.2], [0.1, 0, -0.1], 3]
相机的角位置的4个数字是什么意思?他们是天使吗?以弧度表示?哪个角度?在
以下是Plotly用于3d打印的相机控件的说明:
http://nbviewer.jupyter.org/github/etpinard/plotly-misc-nbs/blob/master/3d-camera-controls.ipynb
为了完整起见,下面是一个简短的总结:
可以使用
camera
代替cameraposition
,因为它似乎有更简单的解释。在相机的位置由三个向量决定:
up
,center
,eye
。在上方向向量决定页面上的向上方向。默认值是
(x=0, y=0, z=1)
,也就是说,z轴指向上。在中心向量确定围绕场景中心的平移。默认情况下,没有平移:中心向量是
(x=0, y=0, z=0)
。在眼睛向量决定了相机关于原点的观察点。默认值是
(x=1.25, y=1.25, z=1.25)
。在也可以通过减少眼睛向量的范数来放大。在
相关问题 更多 >
编程相关推荐