Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there an example anywhere of how I might use this to apply physics to DOM element by chance? #21

Open
HenrikJoreteg opened this issue Jan 18, 2014 · 1 comment

Comments

@HenrikJoreteg
Copy link

I'm guessing I would need to create a simulation and then write a custom renderer that applied resulting values to the DOM elements I'm wanting to apply physics to. But got stuck.

If I knew how to simulate a box of known dimensions and apply gravity to it I feel like I could figure out the rest of it.

@hunterloftis
Copy link
Owner

That's exactly the right approach, although there are many ways you could apply physics to the DOM. You might build something very realistic, or you might just attach a particle with mass to an element to give it a sense of weight, motion, elasticity, etc without manual animation.

I would recommend starting simple and connecting your element to just a single particle. I'd also love to know more about your use case because rendering to DOM is a target goal coming up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants