3D图形:软件可视化三维向量? [英] 3D Graphics: software for visualizing 3D vectors?

查看:827
本文介绍了3D图形:软件可视化三维向量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图教自己对3D图形,但我无法可视化涉及到的3D矢量。

I'm trying to teach myself about 3D graphics, but I'm having trouble visualizing the 3D vectors involved.

有没有办法,我可以使用可视化的三维矢量什么好的软件?

Is there any good software that I can use to visualize 3D vectors?

例如,现在我正在学习有关摄像头的转换,这将是很好,如果我可以很容易地画出右/上/外观/眼载体。

For example, right now I'm learning about camera transformations, and it would be nice if I could easily plot the right/up/look/eye vectors.

我已经试过Grapher.app和gnuplot的,但它很难进入点到Grapher.app和gnuplot的似乎不能够锁定纵横比。

I've tried Grapher.app and gnuplot, but it's very difficult to enter points into Grapher.app and gnuplot doesn't seem to be able to lock the aspect ratio.

推荐答案

视觉的Python 是一个超级简单的库,三维可视化。

Visual Python is a super easy library for 3D visualization.

例如,要显示一个球体和箭头:

For example, to show a sphere and arrow:

import time, math, visual

ball = visual.sphere(pos=(0,2,0), radius=1, color=visual.color.red)
vect = visual.arrow(pos=(2,0,0), axis=(2 ,2,-2))

visual.scene.forward = (.1, -.3, -1)  # controls the camera view angle

这个窗口目前也已经全部正常鼠标交互,如变焦和摄像头(即视角)旋转。

This window now also has all of the normal mouse interactivity, such as zooming and camera (i.e. viewing angle) rotation.

VPython也很容易制作动画。例如,下面将旋转箭头:

VPython is also easy to animate. For example, the following will rotate the arrow:

da = 2*math.pi/100
for timestep in range(100):
    angle = timestep*da
    vect.axis = (2+2*math.sin(angle), 2*math.cos(angle), -2)
    time.sleep(.1)

这篇关于3D图形:软件可视化三维向量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆