This is an embryo of a NativeCall port of the kazmath library.
kazmath is low-level library for manipulation of graphics primitives. It's similar to others graphics libraries such as OpenGL, but it's simpler and , in some cases, faster.
You need to install kazmath from source, compiling it. Follow the instructions to create a shared library.
Then you xan install this from this source or via
zef install kazmath
Since only some functions have been ported, basically you can rotate a vector , like this:
my mat4 $one-mat .= new; my mat4 $turn-pi = kmMat4RotationY($one-mat, pi/2); say $turn-pi; my vec4 $out .= new; my vec4 $in .= new(1.Num, 0.Num, 0.Num, 1.Num); my vec4 $result = kmVec4Transform( $out, $in, $turn-pi); say $result;
Tutorial for NativeCall
Also, this has been built mainly to be used as a recipe in the upcoming Raku Recipes book by APress. Check out all Raku titles in Apress such as this one.
This module is licensed under the Artistic 2.0 License (the same as Raku itself )