Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate Pyrr in favour of PyGLM #176

Open
klattimer opened this issue Aug 23, 2023 · 2 comments
Open

Deprecate Pyrr in favour of PyGLM #176

klattimer opened this issue Aug 23, 2023 · 2 comments
Milestone

Comments

@klattimer
Copy link

Pyrr is slow, incomplete and has some bugs. Numpy code in there isn't accelerated by hardware at all, whereas GLM tends to use the fastest method for the CPU you're on (Neon/VFP etc...). The transition isn't difficult - largely changing Vector3 to glm.vec3. I may provide a PR if that would be of interest.

https://pypi.org/project/PyGLM/
https://github.com/Zuzu-Typ/PyGLM/tree/master/wiki/function-reference < easiest documentation access
https://glm.g-truc.net/0.9.0/api/index.html
https://github.com/Zuzu-Typ/PyGLM/

I switched my app code to pyglm because pyrr dropped my frame rates with every new calculation added, it hit 27fps before I switched, with glm I'm getting 60fps again.

@szabolcsdombi
Copy link
Member

Back when we added the examples using Pyrr PyGLM did not exist. For my newer projects I also use PyGLM, or glm directly from C++. If you or anyone can find the time to upgrade some/all of the examples. I would be really glad to merge it.

The only thing I don't like about PyGLM or glm is the mismatched order of the quaternion members. While math may allow for any representation order such as x, y, z, w, OpenGL and GLSL specifically rely on this order. Unfortunately, glm uses the w, x, y, z order for both memory and constructor layout.

Putting that aside, I think PyGLM is one of the best choises out there.

@klattimer
Copy link
Author

It's not just the examples, but the scene loader too, I think I might be able to do a dirty replace on it if I get time this weekend. Dropping a bad old dependency is always good.

klattimer added a commit to klattimer/moderngl-window that referenced this issue Sep 1, 2023
@einarf einarf added this to the 3.0 milestone Oct 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants