Search the Community
Showing results for tags 'convertcoordinates'.
Hi, I was wondering if it's possible to factor in an intended transformation of the elements into the getRelativePosition or convertCoordinates methods. convertCoordinates doc's For example, in the demo video for convertCoordinates the video shows a fromElement and a toElement which transform by a random scale, rotation etc. and then tween the child element into position using the newly transformed parents. My question is "is it be possible to tween the transformation of both the parents and the child elements at the same time so everything moves synchronously?". (Sorry - I wanted to link to the codepen here but could find the one I was looking for from the video) I can't see how I could do that right now as (as far as I can tell) any elements passed into getRelativePosition or convertCoordinates need to be in a 'final' position i.e. these functions return a transform for where the elements are and not where they are going to be. note: I've seen the 'arm and joint' getRelativePosition demo which uses 'onUpdate' to remap the the arms start position. This could probably be used but it just seems a bit inefficient to continuously recalculate the necessary transform on ticks of the parents tween when we should be able to calculate the final position at the outset using the current positions and intended transformations. Any thoughts on how this might be achieved? Maybe some clever matrix composition?
Hello Everyone I'm struggling with something that I'm not sure if it's trivial, impossible or I'm just doing it wrong. I've checked everything that I could find about .getBoundingClientRect() .getBBox() and I realized that you recently released an suuuuperb update with .convertCoordinates() and a lot of cool stuff. Though I feel a bit silly trying to use it. Or maybe it's way complicated due to 2 different SVGs and their coordinates systems. Please let me know if it's possible to put that blue box over the green one but specifically to #align-line (so the top of the blue box is touching the line) After 6hrs of doing something similar as blue box is doing in the attached CodePen demo and demystifying some awesome @OSUblake demos I would very much appreciate some guidance on this one. Why I have to do this in such way - I have a mask element (a card that comes out of envelope) and it has to be aligned with the envelope - otherwise the animation is a no no - but later I need to position it (card) anywhere on the screen, so the elements must be separated, but in sync - they will also have dynamic sizes and widths depending on the needs and all the stuff wouldn't be much of a problem if not that one sync issue. Hopefully I'm just being silly and it's possible, If not, well I need to rethink the whole thing BTW Thanks for the awesome update! Cheers, Patryk