I'm programming a small psychological experiment with Javascript and Raphael.
It's my first time using Raphael, and I'm not as good with it, as I want to be ;)
Basically, there is a clock and a small point which is running around it. When the test subject presses the space bar, the point should stop and its absolute X and Y position should be saved.
The animation and the reaction to the space bar press works just fine, but I have my problems with getting the absolute position of the point. I'm using a relative transform to move the point within the clock.
clock.customAttributes.along = function (v) {
var point = p.getPointAtLength(v * len);
return {
transform: "t" + [point.x, point.y] + "r" + point.alpha
};
};
You can look up the experiment here: http://narda.bplaced.net/
If you press the space bar, a new point is drawn at the position which is given by matrix.x(x,y) and matrix.y(x,y).
Is there a way to translate a relative transform into an absolute position? Or can I move the point with an absolute transform instead of a relative?
Thank you for any new approach.