Re: Rotations with Quaternions

[email protected]
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
 
Hi Bryce,

A 3x3 matrix should might work for quaternion rotations. In the sample code this is reduced to a 2x2 matrix, or four variables for each circle rotation, by using initial reference points but that wouldn't work in general to preserve rotations. There would be a need to keep the z component of a plane to make the rotations additive. If you assumed z=0 then a first rotation would work but not a second or it wouldn't work as expected.

This probably is something difficult to add to Cairo. There are a lot of places that the cairo_matrix_t touches in the code. Also I think there would be a need for a new matrix for quaternion rotations and if that is done then you run into further difficulties such as the order of matrix multiplication. A lot of speculation at this point.

I got going on this to figure out 3d rotations using Cairo's api. I could get some special case rotations in 3d but not something that would work for a gyro. Working on putting together a little gyro widget with Cairo and GTK. 

I am not familiar with the internals of Cairo. I have looked around a little but I don't have a test setup with the current version. Do you have any suggestions for putting together a test setup? I would be interested in getting a test build set up that I could experiment with. Also to take a look at what you have going with projections.

Eric

-- 
cairo mailing list
[email protected]
https://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.