3D 图形:用于可视化 3D 矢量的软件?

发布于 2024-09-17 19:41:19 字数 202 浏览 10 评论 0 原文

我正在尝试自学 3D 图形,但无法可视化所涉及的 3D 矢量。

有没有什么好的软件可以用来可视化 3D 矢量?

例如,现在我正在学习相机变换,如果我可以轻松地绘制右/上/看/眼向量,那就太好了。

我尝试过 Grapher.app 和 gnuplot,但是在 Grapher.app 中输入点非常困难,而且 gnuplot 似乎无法锁定纵横比。

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.

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

三岁铭 2024-09-24 19:41:19

Visual Python 是一个超级简单的 3D 可视化库。

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

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

alt text

此窗口现在还具有所有正常的鼠标交互性,例如变焦和相机(即视角)旋转。

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

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)

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

alt text

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

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)
扎心 2024-09-24 19:41:19

我不知道这是否比 Grapher.app 或 gnuplot 更容易,但您可以编写自己的 3D 图形程序来绘制向量。

这是一个在 OpenGL 中绘制 X 的示例, Y 和 Z 轴向量。

更新: 这是一个 Java 小程序,专门致力于帮助您可视化相机变换中的向量。请注意安装说明:您必须安装 Java 3D。

描述:透视相机
参数小程序旨在熟悉
具有各种参数的学生
与合成物相关,
透视投影相机。用户
可以调整以下任意一项
参数:视场宽度,
视场高度,近剪裁
平面距离,远剪裁平面
距离、向上向量和外观向量。
视锥体可视化为
窗口,让学生
了解参数之间的关系
视锥体的形状。

同一个站点有许多组件,例如轴,您可以使用它来设置一个简单的小程序,仅显示您想要的矢量。

I don't know if this would be easier than Grapher.app or gnuplot, but you could write your own 3D graphics program that just plots the vectors.

Here's an example in OpenGL that draws the X, Y, and Z axis vectors.

Update: Here's a Java applet specifically focused on helping you visualize the vectors in camera transformations. Note the installation instructions: you have to install Java 3D.

Description: The Perspective Camera
Parameters applet aims to familiarize
students with the various parameter
associated with a synthetic,
perspective-projection camera. Users
can adjust any of the following
parameters: field-of-view width,
field-of-view height, near clipping
plane distance, far clipping plane
distance, up vector, and look vector.
The viewing frustum is visualized in a
window, allowing students to
understand how the parameters relate
to the shape of the viewing frustum.

The same site has many components, such as axes, that you can use to set up a simple applet showing just the vectors you want.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文