适用于Python的OpenGL矩阵数学实用程序? [英] OpenGL matrix math utilities for Python?

查看:40
本文介绍了适用于Python的OpenGL矩阵数学实用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我自己做之前,是否有任何Python库可用于4x4矩阵上的OpenGL特定/兼容矩阵数学?基本上,我需要Android的 android.opengl.Matrix 类提供的功能集. >

Before I do it myself, are there any Python libraries available for OpenGL-specific/compatible matrix math on 4x4 matrices? Basically, I need about the feature set offered by Android's android.opengl.Matrix class.

推荐答案

您可以使用 numpy 生成数据与OpenGL兼容.许多 PyOpenGL 调用可以直接采用numpy数据结构(假设它是正确的类型).此外,numpy数组通常在内存中排列良好,因此您可以对数据进行所需的操作(并且很容易检查 的排列方式).

You can use numpy to generate data that is compatible with OpenGL. Many of the PyOpenGL calls can take numpy data structures directly (assuming it's the correct type). Additionally, numpy arrays are typically well arranged in memory, and so you can do what you want with the data (and it's easy to check how they are arranged).

这篇关于适用于Python的OpenGL矩阵数学实用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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