maximinus Posted September 30, 2018 Share Posted September 30, 2018 I have the co-ordinates of a triangle that I want to be a static phsyics object in matter.js. My code is: var triangle_points = this.matter.world.fromPath('0 0 100 0 0 100'); var triangle = this.matter.add.image(x, y, 'image', null, {shape: {type: 'fromVerts', verts: triangle_points}}); triangle.setStatic(true); However, when this object is added, the triangle is offset by the center of mass of the triangle. How do I either prevent this, or work out the co-ord offsets so I can move the triangle back to the exact pixel position I need? Link to comment Share on other sites More sharing options...
Recommended Posts