[cairo] Rotations with Quaternions

cecashon at aol.com cecashon at aol.com
Tue Jan 16 19:23:12 UTC 2018


 
Thinking about this a little more, you can get 3d quaternion rotations using a cairo matrix with the restriction that you only get one rotation. This is assuming z=0 for the rotation. After one rotation z wouldn't be 0 anymore. That would mean you would have to put your 3d rotation and drawing in a cairo_save(), cairo_restore() pair to use it for several consecutive drawings. It wouldn't be directly compatible with Cairo's other 2d tranforms either. Not too bad though considering you get 3d rotation of a plane without changing anything internally in Cairo.

https://github.com/cecashon/OrderedSetVelociRaptor/blob/master/Misc/cairo_drawings/rotation1.c

Eric


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cairographics.org/archives/cairo/attachments/20180116/92ce8b5b/attachment.html>


More information about the cairo mailing list