b-g / p5-matter-examples Goto Github PK
View Code? Open in Web Editor NEWExamples showing how to combine p5.js and matter.js.
Examples showing how to combine p5.js and matter.js.
We (@b-g and me) used the magnet class in the "attractor duo" example and noticed that it might not behave like an actual magnet 😆
I think in reality once an element comes closer to one magnet, it would snap towards that magnet, because pull force is not linear to distance.
Apparently the pull force of a magnet follows the "inverse square law".
Maybe you know more @ByronStar
The fix here causes a bug where shapes imported via SVGs are placed at 0/0 instead of the position they should be.
Example project:
project.zip
like https://github.com/liabru/matter-js/blob/master/src/body/Body.js#L109
/**
* Returns the next unique group index for which bodies will collide.
* If `isNonColliding` is `true`, returns the next unique group index for which bodies will _not_ collide.
* See `body.collisionFilter` for more information.
* @method nextGroup
* @param {bool} [isNonColliding=false]
* @return {Number} Unique group index
*/
/**
* Creates a new rigid body model with a circle hull.
* The options parameter is an object that specifies any properties you wish to override the defaults.
* See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object.
* @method circle
* @param {number} x
* @param {number} y
* @param {number} radius
* @param {object} [options]
* @param {number} [maxSides]
* @return {body} A new circle body
*/
At the main page https://b-g.github.io/p5-matter-examples/, clicking on the last example brings you to the wrong url.
Would be nice to have a soft body example eg. https://mstdn.social/@golan/109886915779931595
Hier steht “ball” drinnen, allerdings funktioniert das ganze umso besser mit “matterObj”
What exactly does the matter - wrap library do?
I think I found some issues with the class:
(See examples here)
1-image-on-path
)
offset
, but it doesn't seem to do anything (should it?). But even if it works I think both images should align out of the box1-image-on-path
)2-path-not-working-without-scale
) (especially since the console also doesn't throw an error)3-not-drawing-stroke
)
strokeWeight
instead of weight
, and fill
instead of color
, to stay consistent with p5's terminologyMaybe @b-g or @ByronStar
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.