Not able to create concave object as it is achieved in the demo
See original GitHub issueI am trying to make concave object but alas I recieve:
matter.min.js:55 Uncaught TypeError: c.makeCCW is not a function
at Object.o.fromVertices (matter.min.js:55)
at main.js:558
at Object.o.stack (matter.min.js:57)
My implementation is as follows:
var chevron = Matter.Vertices.fromPath('100 0 75 50 100 100 25 100 0 50 25 0');
var stack = Matter.Composites.stack(50, 50, 6, 4, 10, 10, function(x, y) {
var color = '#556270';
return Bodies.fromVertices(x, y, chevron, {
render: {
fillStyle: color,
strokeStyle: color,
lineWidth: 1
}
}, true);
});
var add = function(body) {
World.add(engine.world, [body]);
}
add(stack);
I thank you for your help it is very nice engine! but I digress…
Best,
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Generate compound colliders with one click! [RELEASED]
In Unity mesh to mesh collisions only work if at least one of the meshes is convex. The Concave Collider helps overcoming this...
Read more >Concave Mirror Demo - YouTube
This is a demonstration of the images formed by a concave mirror as a function of the distance of ... Your browser can't...
Read more >Concave mirror real image demonstration /// Homemade ...
Your browser can't play this video. Learn more. Switch camera.
Read more >Understanding Physics: Collision Shapes, Mesh vs Hull ...
Your browser can't play this video. ... Understanding Physics: Collision Shapes, Mesh vs Hull, Concave vs Convex - for Unity and Buildbox.
Read more >Ray Diagrams - Concave Mirrors - The Physics Classroom
A ray diagram shows the path of light from an object to mirror to an eye. ... While plane mirrors always produce virtual...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That is a list of vertices in the form
x y x y x y ...
, the origin will be calculated as the centre of mass of that shape.“Matter.Vertices.fromPath(‘100 0 75 50 100 100 25 100 0 50 25 0’);”
DOES anyone understand how this works? The first 100 0 is supposed to be the origin? Say if I wanted to just make a triangle, how do I plot it out? The last two 25 0 must be something important too?