Jump to content
Search Community

Physics2D

julien94270 test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hi,

 

I have a "simple" question about Physics2D.

I was looking for an easy tutorial to enjoy this plug-in (I haven't found one :-) ),
but when I land on http://greensock.com/docs/#/HTML5/GSAP/Plugins/Physics2DPlugin/,

it's written that it requires  to be member in Club Greensock.

 

Is there a way to test, and easy examples to learn how to use it, before suscribe ?

 

I have just found this :  but it is not really clear to me because

it is not only focused on Physics2D ...

 

Thanks a lot !

 

See the Pen yhEmn by GreenSock (@GreenSock) on CodePen

Link to comment
Share on other sites

Glad you asked.

Yes, you definitely can try out any of the plugins on CodePen, and we encourage it.

 

Here are 2 demos that should get you started:

 

Super simple

http://codepen.io/GreenSock/pen/GgVrNZ?editors=011

 

Particle effect

http://codepen.io/GreenSock/pen/emjgxw?editors=001

 

You can fork either of them and edit the html / css / js all you want.

 

Sorry they weren't easier to find. I'll have to make a note to add some demos to the docs and plugin pages.

 

To test out other plugins please see this collection: http://codepen.io/collection/qHasJ/

 

 

Let us know if you have any more questions.

  • Like 1
Link to comment
Share on other sites

  • 4 years later...

Is there any way to use the above plugin for three js object. Here what I am trying. 

 

var tween = new TimelineMax();
		let o = {
			velocity : this.getVel() * 1000,
			angle : Math.PI + (o2.angle * 180 / Math.PI),
			gravity : 0,
			xProp : "x",
			yProp : "z"
		};

		tween.to(eleHolder.position, 2, {
			physics2D : o,
			/*yoyo : true,
			repeat : -1,*/
			onUpdate : function() {
				console.log(this)
				$this.onUpdate();
				
			}
		}, 0);

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...