C# 中 3D 数学的好库? [英] Good library for 3D math in C#?

查看:29
本文介绍了C# 中 3D 数学的好库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个工具,该工具将用于处理一堆 3D 数据,执行诸如旋转对象、平移、缩放等所有功能.有没有人知道一个很好的库,它已经做了一些常见的 3D 东西?

I'm writing a tool that is going to be used to process a bunch of 3D data, doing things like rotating objects, translating, scaling and all that good stuff. Does anyone know of a good library that already does some of this common 3D stuff?

我目前对可视化数据不感兴趣,主要对执行操作感兴趣.

I'm not interested in visualizing the data at the moment, and am primarily interested in performing the operations.

我知道我现在需要的东西:

Things I know I will need at this point:

  • 2D/3D/4D 矢量
    • (加、减、点积、叉积等...)

    我能够找到 Sharp3D 库,但它似乎可以做我想做的事,但没有好久没更新了有没有人以前用过这个?还有其他(更好的)建议吗?

    I was able to locate the Sharp3D library, but it seems like it might do what I want but hasn't been updated in a long time. Has anyone used this before? Any other (better) suggestions?

    推荐答案

    Microsoft.Xna.Framework(发布此 XNA)可以完成这项工作.

    Microsoft.Xna.Framework (ship this XNA) could do the work.

    XNA 框架数学库具有多种基本几何类型,可用于在 2D 或 3D 空间中操作对象.该库中的原始对象表示表示几何对象或对该对象的操作所需的数据.每种几何类型都有许多该类型支持的数学运算.

    The XNA Framework Math library has multiple basic geometric types that can be used to manipulate objects in 2D or 3D space. The primitive objects in this library represent the data required to represent a geometric object or an operation on that object. Each geometric type has a number of mathematical operations that are supported for the type.

    矢量

    XNA 框架提供了 Vector2、Vector3 和 Vector4 类来表示和操作向量.矢量通常用于表示方向和大小.但是,在 XNA 框架中,它也可能用于存储坐标或其他具有相同存储要求的数据类型.

    The XNA Framework provides the Vector2, Vector3 and Vector4 classes for representing and manipulating vectors. A vector is typically used to represent a direction and magnitude. However, in the XNA framework it might also be used to store a coordinate or some other data type with the same storage requirements.

    每个向量类都有执行标准向量操作的方法,例如:

    Each vector class has methods for performing standard vector operations such as:

    • 点积
    • 交叉产品
    • 标准化
    • 转型
    • 线性、三次、Catmull-Rom 或 Hermite 样条插值.

    矩阵

    XNA 框架提供了用于几何变换的 Matrix 类.Matrix 类使用行主序来寻址矩阵,这意味着在描述二维矩阵的元素时,在列之前指定行.除了用于创建缩放、平移和旋转矩阵的辅助方法之外,Matrix 类还提供了用于执行标准矩阵运算(例如计算矩阵的行列式或逆矩阵)的方法.

    The XNA Framework provides the Matrix class for transformation of geometry. The Matrix class uses a row major order to address matrices, which means that the row is specified before the column when describing an element of a two-dimensional matrix. The Matrix class provides methods for performing standard matrix operations such as calculating the determinate or inverse of a matrix, in addition to helper methods for creating scale, translation, and rotation matrices.

    四元数

    XNA Framework 提供了 Quaternion 结构来表示和计算围绕指定角度的向量的有效旋转.

    The XNA Framework provides the Quaternion structure to represent and calculate the efficient rotation about a vector around a specified angle.

    这篇关于C# 中 3D 数学的好库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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