Realtime Fracturing

0 favourites
  • 11 posts
From the Asset Store
Basic Plugins for Firebase Authentication, Realtime-Database, Firestore, Cloud Storage
  • Hi,

    I searched far and wide and before I animate it or hack it I wonder if someone can help with breaking or cracking a given object.

    The fracture should start specifically where the user clicks the object, then these smaller pieces can be fractured too.

    Is this feasible and if so let me know your budget.

    Thanks a billion!

  • Sounds interesting. Can you tell us more about the project? What do these objects look like? What should the fracture line look like? What happens to the fractured objects?

  • I’m not for hire but ideas are free.

    There are some example on the forum of fracture by just creating premade pieces and destroying the original object. Also there should be an example somewhere of object slicing. Maybe in a fruit ninja question.

    The meat of it is being able to clip a polygon by a line, polyline or another polygon. That basically amounts to keeping a list of points of the polygons and calculating intersections of line segments and testing if a point is inside a polygon or on either side of a line. You’d want all the polygons to be convex

    To draw the polygons you could use a drawing canvas or use a distort mesh. The distort mesh is better in that it has collisions and is textured.

    After that it’s just a matter of defining how you want it to fracture. Start with just drawing the fracture pattern you’re after. Then you could just use the polygons from that to do the clipping or you could try to procedurally try to generate similar patterns.

    For a super realistic fracture you could define the density of the object as a varying noise texture then doing some kind of pathfinding through that to make the crack. But that’s probably slow and excessive.

  • Sounds interesting. Can you tell us more about the project? What do these objects look like? What should the fracture line look like? What happens to the fractured objects?

    You're mining rock or ore to find rare earth elements. So the object stay on screen as long your batch isn't done mining. Some fractions reveal to gems and so on.

  • I’m not for hire but ideas are free.

    There are some example on the forum of fracture by just creating premade pieces and destroying the original object. Also there should be an example somewhere of object slicing. Maybe in a fruit ninja question.

    The meat of it is being able to clip a polygon by a line, polyline or another polygon. That basically amounts to keeping a list of points of the polygons and calculating intersections of line segments and testing if a point is inside a polygon or on either side of a line. You’d want all the polygons to be convex

    To draw the polygons you could use a drawing canvas or use a distort mesh. The distort mesh is better in that it has collisions and is textured.

    After that it’s just a matter of defining how you want it to fracture. Start with just drawing the fracture pattern you’re after. Then you could just use the polygons from that to do the clipping or you could try to procedurally try to generate similar patterns.

    For a super realistic fracture you could define the density of the object as a varying noise texture then doing some kind of pathfinding through that to make the crack. But that’s probably slow and excessive.

    Thank you for sharing these insight! I will save them for later use with a dev.

  • One more question for R0J0Hound.

    How much would it roughly cost to outsource? Its indeed a textured mesh (like you said) and part of the games economy.

    Hope to hear from you.

    Thanks,

  • No idea really. I’m a hobbyist not a freelancer.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Alright.

  • Here's a way to do it. The meat of it is to take a line and divide a polygon into two. Then you can utilize a mesh distort to apply a polygon to a sprite. The more complex part was to eliminate bad edge cases.

    When you right click on the sprite it divides it in two then divides one of the halves in two as well. There are probably other strategies to break things up.

    dropbox.com/scl/fi/ufj7xvqguta7lcbmo7ia2/mesh_slice3.c3p

  • Here's a way to do it. The meat of it is to take a line and divide a polygon into two. Then you can utilize a mesh distort to apply a polygon to a sprite. The more complex part was to eliminate bad edge cases.

    When you right click on the sprite it divides it in two then divides one of the halves in two as well. There are probably other strategies to break things up.

    https://www.dropbox.com/scl/fi/ufj7xvqguta7lcbmo7ia2/mesh_slice3.c3p?rlkey=jf1lzb7p2v1n80lhw7en2lvsg&st=wmpje5zg&dl=1

    Your example is spectacular.

  • Here's a way to do it. The meat of it is to take a line and divide a polygon into two. Then you can utilize a mesh distort to apply a polygon to a sprite. The more complex part was to eliminate bad edge cases.

    When you right click on the sprite it divides it in two then divides one of the halves in two as well. There are probably other strategies to break things up.

    https://www.dropbox.com/scl/fi/ufj7xvqguta7lcbmo7ia2/mesh_slice3.c3p?rlkey=jf1lzb7p2v1n80lhw7en2lvsg&st=wmpje5zg&dl=1

    This was really cool! Fun to play with and look at your code.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)