Search the Community

Showing results for tags 'easing'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 6 results

  1. Alright errybody This is a question more about maths than anything else, and i'm terrible at maths so I'm hoping someone (maybe @Wingnut) can help me here. My scene is loaded from a blender export, which in itself is partially an imported FBX from C4D (still waiting on that C4D exporter boys!). I have a mesh within the scene that has a set position, and I want to allow it to orbit in a circle when clicked or tapped by the user. Fundamentally this is fine and I have most of the logic in place, but I'm struggling to figure out how to make it animate from it's initial position. All of the example code I've seen make the object jump to a calculated first position and then animate, which is not what I want. Has anyone got some sweet ninja code that I can borrow steal that will do what I need? Additionally is there a convenient technique or built in method to add easing to the beginAnimation call, or to the calculated keyframes? Cheers! Here's my current code: var onMeshPicked = function(bjsEvent) { myPickedMesh = bjsEvent.source; var frames = 90; // number of points var parent = myPickedMesh.parent; parent.indexPoint = 0; var p=0; var points = []; var radius = 2; for (var i = 0; i < frames; i++) { // calculate the keyframes points.push( new BABYLON.Vector3((radius + Math.sin(i*Math.PI/frames))* Math.cos(2*i*Math.PI/frames), parent.position.y, ( radius + Math.sin(i*Math.PI/frames)) * Math.sin(2*i*Math.PI/frames))); } parent.points=points; var path3d = new BABYLON.Path3D(points); var tangents = path3d.getTangents(); //array of tangents to the curve var normals = path3d.getNormals(); //array of normals to the curve var binormals = path3d.getBinormals(); //array of binormals to curve parent.animationPosition = new BABYLON.Animation("animPos", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE); parent.animationRotation = new BABYLON.Animation("animRot", "rotationQuaternion", 30, BABYLON.Animation.ANIMATIONTYPE_QUATERNION, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE); var keysPosition = []; var keysRotation = []; for(i = 0,p=frames; i < p; i++) { keysPosition.push({ frame: i, value: parent.points[i] }); keysRotation.push({ frame: i, value: BABYLON.Quaternion.RotationQuaternionFromAxis(normals[i], binormals[i], tangents[i]) }); } parent.animationPosition.setKeys(keysPosition); parent.animationRotation.setKeys(keysRotation); scene.beginDirectAnimation(parent, [parent.animationPosition,parent.animationRotation], 0, frames, false, 0.25,null); };
  2. niallos

    Drag camera with easing

    How would I go about adding easing when the camera is dragged on my phaser example http://jsfiddle.net/YHj24/35/ At the moment the movement ends straight away as soon as the drag is finished. I'd like it to carry on for a moment and decelerate ( similar to when you scroll through a list on a smartphone ). Thanks very much
  3. Hi all, I was looking at using tweens in a simple application, and something struck me as odd when using `game.add.tween.to`. By looking at examples like this, it looks like you can pass in the easing function without specifying any arguments for it. E.g., game.add.tween(purpleFish).to({ x: -200 }, 7500, Phaser.Easing.Quadratic.InOut, true, 0, 1000, false);Reading from the docs, methods like Phaser.Easing.Quadratic.InOut need arguments to be passed in or they'll return NaN. However, the code above works fine without any arguments getting passed in to Phaser.Easing.Quadratic.InOut. Is something going on here internally that passes in those arguments for you?
  4. Maybe I'm blind but is there anywhere a list of available easing effect of Phaser? such like: game.add.tween(this.pauseMenuBTNcancel).to({y:game.height - 200},0, Phaser.Easing.Bounce.Out, true);cheers
  5. I have side scroller platform game. I want to add some easing to camera follow the character. I am using camera.follow(char) method. Any help on this is appreciable.
  6. Hi there, I´m trying to find something about this but... not working. Anyway, I have two tweens on my game and I need to do that with Phaser.Easing.Elastic.InOut Everything is cool, the only problem is that the "elasticity" is tooo much, I want the animation being elastic but not so much, how can I control that? I don´t know how to use the "example" in the documentation... InOut(k) → {number} Thanks in advance mates!