![](https://secure.gravatar.com/avatar/283b2540e7846a3831b030a05daf968e.jpg?s=120&d=mm&r=g)
MenTaLguY wrote:
On Tue, 2004-06-22 at 15:11, John Cliff wrote:
Have commited the stuff I was working on to
give control knots for manipulating pattern fills. Knots are currently provided for translation, rotation and scaling. Theres a circular node at the pattern 0,0 with 2 diamonds, one to the right, and on below (in the pattern co-ord system). To move the pattern, drag the circle, to rotate, drag the diamond to the right, to scale the one below. I'm putting thought into how best to do skew and non uniform scale, however need to discuss that with people, both from UI and maths point of views, so dont intend trying to get those done for 0.39.
I would personally put 4 knots on the diagram. gets rid of the hidden mode (rotation).
Editting in place as it's easier :)
I think a better approach, given that arrangement of knots, is something like this (imagine X is your diamond shape):
^ V (skew)
O--------------------X <-> (scale) | | | | | | X <-> (skew)--------* (rotate and scale)
^ V (scale)
So, from the initial position (i.e. no transform) dragging the:
center knot: any direction = translation
right knot: up or down = skew vertically right or left = scale horizontally
bottom knot: right or left = skew horizontally up or down = scale vertically
bottom right knot: scale and rotate like normal objects
Really the behviour should be as close to the normal object behaviour as possible.
Nathan or someone can help you with the math to reverse the process and compute the "delta" transform between two knot positions if you can't figure it out (I'm tired and have a headache).
The code already does this in seltrans.cpp - look at that, maybe you could even factor out a common function (I've pondered whether the rotate etc handles should be done with knots too)
njh