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

Add vector, matrix and quaternion operations for 3d geometry #437

Open
bbesseling opened this issue Nov 18, 2021 · 1 comment
Open

Add vector, matrix and quaternion operations for 3d geometry #437

bbesseling opened this issue Nov 18, 2021 · 1 comment

Comments

@bbesseling
Copy link

The library could more easily support common 3d geometry operations as e.g. used in cad and games.
Vector: If we could add left/right-handed cross product? If we could slerp and interpolate using a function?
Matrix: If we could factory scale, rotation and translation 2x2, 3x3 and 4x4 (+w) matrices and maybe their inverses?
Quaternion: If we could factory from axis+angle, euler or at+up vectors? If we could slerp, nlerp and interpolate using a function?
It is also very useful in 3d to have a Transform type that keeps scale, translation and rotation as separate vectors and a quaternion. This eliminates many matrix inversions e.g. when animating boned 3d meshes.
Stretch goal nice to have a Project type that can do perspective and isometric projections. from 3d to 2d for rendering.
Since these operations are all very simple, is it better for me to write the code and for someone then to validate the code, or is it easier for somebody who already understands the code to add these?
I'd be happy to provide C++ sample code.

@markrogoyski
Copy link
Owner

Hi @bbesseling,

Thank you for your interest in MathPHP.

If you have ideas or requests for specific new math functions, can you provide some concrete examples of how you expect them to work. For example, a function called XYZ that takes an input 2x2 matrix with values (...) and produces as output a 2x2 matrix with values (...). Also, if there is any external documentation (could be Wikipedia or anything) on the function provide that as well so we can make sure we understand your request. And finally, if the functionality you are requesting exists in any other libraries, providing a reference to that is also useful to get ideas from.

And of course, the quickest way would be to provide code yourself in the form of a pull request.

Thanks,
Mark

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

2 participants