Jump to content
Search Community

Pilatus

Business
  • Posts

    28
  • Joined

  • Last visited

About Pilatus

Profile Information

  • Location
    Switzerland

Recent Profile Visitors

2,417 profile views

Pilatus's Achievements

7

Reputation

  1. I resolved the issue, I was assigning matrixes manually, hence losing scale/rotation information. Now I use GSAP for the whole mouse interaction from start to end, and it works.
  2. Everytime I receive a delta object, I just moved the mouse a little bit, I get a mouse movement notification, calculate the difference in scale and angle, then apply it to the object. it works but scale is perturbed by rotation. I'll try to build something extremely simple to pin point the problem, but it's not easy because it's part of a big project.
  3. TweenLite.set(dummySprite, {transformAroundCenter: {rotation: dummySprite.rotation + rad2deg(delta.angle), scaleX: dummySprite.scaleX*delta.scale, scaleY: dummySprite.scaleY*delta.scale}}); When I rotate an object, also its scaling properties are affected and when I apply rotations over and over this effect is accumulated. See video of the effect (if you still don't see the HD version, wait a bit that google renders it), I just enabled rotation in there, as you can see, scaling is being affected. Essentially the scaling values shrink. I tried multiple ways to counter this effect but without success, how could I do it? There must be a trick for this. If I just scale with some rotation already existing, the rotation is not affected too much. But when I rotate, scaling is perturbed really bad. Maybe there is something I miss. This is what I tried but it didn't work, banging my head on how to solve this. if(delta.angle != 0 && delta.scale != 0) { TweenLite.set(dummySprite, {transformAroundCenter: {rotation: dummySprite.rotation + rad2deg(delta.angle), scaleX: dummySprite.scaleX*delta.scale, scaleY: dummySprite.scaleY*delta.scale}}); } else { if(delta.angle != 0) { var unperturbedScaleX:Number = dummySprite.scaleX; var unperturbedScaleY:Number = dummySprite.scaleY; TweenLite.set(dummySprite, {transformAroundCenter: {rotation: dummySprite.rotation + rad2deg(delta.angle)}}); TweenLite.set(dummySprite, {transformAroundCenter: {scaleX: unperturbedScaleX/dummySprite.scaleX, scaleY: unperturbedScaleY/dummySprite.scaleY}}); } else if(delta.scale != 0) TweenLite.set(dummySprite, {transformAroundCenter: {scaleX: dummySprite.scaleX*delta.scale, scaleY: dummySprite.scaleY*delta.scale}}); }
  4. Yes, resolved Thanks to you guys. Do you plan on releasing the new .swc? At the moment I just had to add the class in my project sources, it does bypass the .swc old class.
  5. Ok, my app is quite complex so I had to make an effort to extract and minimize to an example. I posted also resulting video animations and yes I am not getting what I really want. I want the object to move past the left edge and get out of the way, rotating around its own the center. This is the code with x inside transformAroundCenter: var o:flash.display.Sprite = new flash.display.Sprite(); o.graphics.beginFill(Color.RED, 1); o.graphics.drawRect(400, 400, 100, 100); o.graphics.endFill(); addChild(o); TweenLite.to(o, 200, {useFrames: true, transformAroundCenter:{x: -400, rotation:360}}); this is the result animation: https://tinyurl.com/ljcgdth ------------------------------------------------------------------------------------------------------------------------ This is the code with x outside transformAroundCenter: var o:flash.display.Sprite = new flash.display.Sprite(); o.graphics.beginFill(Color.RED, 1); o.graphics.drawRect(400, 400, 100, 100); o.graphics.endFill(); Starling.current.nativeStage.addChild(o); TweenLite.to(o, 200, {useFrames: true, x: -400, transformAroundCenter:{rotation:360}}); this is the result animation: https://tinyurl.com/m69orgn
  6. I am running a simple animation which animates an image to negative x coordinates outside the stage towards the left, so that the image disappears. When I enable transformAroundCenter, the image would stop with its center point at x 0, so I see half of it on the left edge. If I disable transformAroundCenter, then the animation completes properly. Is this the wanted behaviour? I would expect the animation to just work and move the object out of the way.
  7. Actually I am already using Starling. I can use GSAP with starling faking the animaton with a dummy sprite and then updating all the animation matrixes into the starling display object, frame by frame. I use GSAP for matrix calculation only, then "steal" the matrix out the dummySprite and give it to Starling, then play it. The problem is still there in Starling as it is in Flash, no difference. For my project I will also try to output to WebGL in the future, still using GSAP, and see how it goes, but for now it seems like I've hit an hard limit with the Flash Player. Indeed, there is nothing I can do to avoid that little flicker every now and then. I could try tiling the image and see, but for now sufficiency is what matters!
  8. Hello, When I animate large images (e.g. 1600x900 px) throughout the screen, I see it stuttering sometimes. Animation must run at 60 fps with big images, otherwise it won't show smooth. I suspect these stutters I see every now and then, say once every 15 seconds, are nothing else than my process being preempted by the OS.. Even a the smallest preemption can cause a the process to lose minimum 10-15 ms, so in that time slice I lose the opportunity to play that frame (at 60 fps it has to play 1 frame every 16.6 ms). So if the amount of time to draw completely that frame is more then 6.6-1.6 ms, it will stutter... isn't it? Probably, with big images, the amount of time to draw stuff is more than 1.6-6.6 ms. My conclusion is that we cannot get rid of these problems, can we? So to recap, the eye needs to see 60 fps played, if we get preempted it won't play 60 fps, but say 57, then it it will be noticeable immediately. Indeed try to set 57 fps on large images, you will see the same stuttering happening more often than not. At the same time we cannot go over 60 fps as far as I know because we are approaching that minimum 10-15 ms quantum assigned to the drawing thread. Catch 22 situation. Do we need RTOS if we want smooth animations all the time? Thing is that customers complain about these stutters every now and then!
  9. I made it work like this: TweenMax.set(dispObj, {x:dispObj.x, y:dispObj.y}); dispObj.alignPivot(); TweenMax.set(dispObj, {x:dispObj.x+dispObj.pivotX, y:dispObj.y+dispObj.pivotY}); TweenMax.to(dispObj, 210, {useFrames:true, rotation: deg2rad(360), scale: 0.5, yoyo:true, repeat:-1, ease: Linear.easeNone}); Haven't really understoon why through, was more a trial error process. Scaling and rotating around center with yoyo.
  10. aaah shame, would be nice to have a workaround.
  11. Hello, Is there a way to rotate starling display objects around the center? The plugins do not work with starling so there must be another way to use TweenMax with it. Thanks.
  12. Makes sense, but how would I retrieve the matrix values once I set the progress? Like it's explained here: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/geom/Matrix.html a,b,c,d,tx,ty Maybe I need to calculate the values of a,b,c,d out of "X,Y, skewY, skewX, rotationY, rotationX, scaleY, scaleX".
  13. Hi, Is it possible to get all the intermediate transform matrix of a tween given the start, end and time? Without actually executing the animation. Thanks.
×
×
  • Create New...