[cairo] Rotations with Quaternions

cecashon at aol.com cecashon at aol.com
Sat Jan 20 05:31:57 UTC 2018


 
Hi Bryce,

Making some progress but still testing. I put the code that does the rotations within the program, into a widget. The drawing looks sharp and works well.

https://github.com/cecashon/OrderedSetVelociRaptor/tree/master/Misc/VeloGyro

With the rotation1.c program I added the rings and have cairo do all the rotations. It uses the existing cairo matrix, a little bit of a hack, to transform the points in the drawing. Just need to use a cairo_save() and cairo_restore() pair. Better performance here. Works and looks good. Might end up merging it into the widget.

I got cairo setup to test with. Still testing in user space with GTK+ though. Like the animation stuff. 

This could use a 3x3 matrix but right now it is being reduced to 2x2 which seems to work pretty good for 3d rotations in 2d.

Eric


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cairographics.org/archives/cairo/attachments/20180120/9e4d3a19/attachment.html>


More information about the cairo mailing list