On 8 May 2013 22:19, Alexandre Bergel alexandre.bergel@me.com wrote:
Your matrixes are 2x2 ? I thought they would be 3x3, I haven't verified, by having 3x3 for 2d plans allows for zooming. But maybe you do not need since Athens handles this apart.
well, matrix in athens is 2x3 affine matrix. (consider it is like a full 3x3 matrix but with all zeros at bottom row) simply because if you extend 2d vector to 3d, you put z-component to 0.. that means , if you multiply such vector with full 3x3 matrix, the 3rd row will be completely ignored, because z-component does not contributes to x and y coordinates.
did you try the code snippet of igor that I sent to the list? Because you can zoom in a vector graphics polymetric view.
Well, I had a look at the code. The matrix of Athens are indeed small and neat. Replacing this in Roassal is not trivial and cannot be done in a matter of a few minutes.
But don't be fooled by concrete (AthensAffineTransform) matrix. In reality, Athens works with abstract "transform" object (AthensTransform) i.e. canvas pathTransform or canvas paintTransform and while under the hood, things are run by matrices, i really discourage you from betting what kind of data they hold, and either they are 2x3 , 3x3 of 4x4 matrices. This is backend-specific and not of your concern. For that reason, the API prohibits you from directly accessing the matrix state (i.e. get/set value at rowN columnM).
Instead there's operators (methods) which modifying transform e.g.
canvas pathTransform scaleBy:2
means that for all subsequent operations
canvas pathTransform will become the result of: (current canvas pathTransform * scale matrix)
same for the rest operations.
For more details, look at AthensTransform class comment. It is a bit outdated, but you will get an idea.
Alexandre
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.