计算机图形几何的Haskell库? [英] Which Haskell library for computer graphics geometry?

查看:168
本文介绍了计算机图形几何的Haskell库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Haskell的计算机图形学中做一些实验。这将包括做一些几何计算并最终写一个光线追踪器。我应该选择哪个图书馆来轻松处理向量,矩阵和相关操作?



Hackage上很少有包括像 vect AC-Vector ,但很容易在很多不同的库中错过一个好的候选者。

解决方案

和用于转换的矩阵, vect 可能是您的最佳选择赌注。它针对您所描述的快速,低精度(如 Double 精度,而不是 Ratio 精度)转换进行了优化,以及它在 lambdacube 中的矩阵堆栈的作用(作为性能是关键的应用程序的一个示例)表明它对于大多数应用程序来说足够快。



对于数据矩阵 - 例如用于图像的 - 您'd可能希望使用 repa ,并行计算,如光线追踪。

I would like to do some experiments in computer graphics in Haskell. This will include doing some geometry calculations and ultimately writing a ray tracer. Which library should I pick for easy handling of vectors, matrices and relevant operations on them?

There are few on Hackage including nice looking ones like vect and AC-Vector, but it's easy to miss a good candidate among so many different libraries.

解决方案

For vectors and matrices that are used for transformations, vect probably is your best bet. It is optimized for fast, lower-precision (as in Double precision as opposed to Ratio precision) transformations like you described, and its role as the matrix stack in lambdacube (as an example of an application where performance is key) shows that it is fast enough for most applications.

For data matrices - that are used for images, for example - you'd probably want to use repa, especially when doing data-parallel computations such as ray tracing.

这篇关于计算机图形几何的Haskell库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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