onsdag 21 juli 2021

Update3

 I took a bit of a break but I've made the edges breakable now. By adjusting the variable that says how easy it is for the bonds to break we can get different behavior. I made 3 videos to demonstrate how it looks with strong, medium and weak bonds. 

Strong Bonds


With the strong bonds the cube stays intact, it stays wobly for a while but that might be fixable by adjusting some of the values.

Medium Strenght Bonds


The way the cube breaks looks pretty good but the way it colapses on itself is a bit weird, it's probably because I haven't implemented collision between the internal nodes. 

Weak bonds


With weak bonds the cube really gets destroyed and it looks pretty good. It's kinda weird how the leftover pieces of geometry kinda spins on the ground but that can probably be fixed by adding friction.


måndag 28 juni 2021

Update2

I've added the spring physics, I've also added gravity and a repulsion force from the ground. I might add friction and collisions later but I'll leave it as is for now. I've updated the visuals to make it easier to comprehend what is going on, with the node spheres being smaller and the edges being visualized by lines. It took while of adjusting the values before I managed to get it to a stable position but it works now. At the moment the edges doesn't break, so my next step is going to be to make them breakable and then dropping the object from a height to see if it breaks.


tisdag 22 juni 2021

Update1

 I've structured up the code and created both a node class and an edge class to keep track of the data. I also have a class that controls everything and creates the breakable object. The object will be consisting of a bunch of nodes connected with edges in a cube formation. The edges will then apply spring forces to the nodes. If the springs are stiff enough this will hopefully mean that the object will be unmoving in its resting state and once enough force is put on the object it will start deforming and eventually crack. I haven't started applying the physics yet but I've made the code for constructing an object with a set width/height/depth. At the moment I'm using spheres to represent the nodes but there's currently no visual representation of the edges.




onsdag 16 juni 2021

New attempt

 It was too long since I worked on this course so I'm redoing the project from scratch following this paper Animation of fracture by physical modeling (kth.se) while keeping the lessons learned from my previous attempt in mind (so not really from scratch I guess). The custom mesh aproach caused too many problems and was a pain to deal with so I'm rethinking my aproach. The current plan is to keep the visual programing seperated from the logic programing and when the logic is done I can then either represent the nodes in the form of cubes that are easier to work with or give the custom mesh another go. I'll try to make an update after each working session from now on until I'm done.

måndag 24 augusti 2020

I'm back

 I had to focus on my Bachelor for a while and after that I had some health issues and needed a break but I'm back now to try and finish this thing. New courses are starting so updates might be sporadic but I'll try to finish it before the end of the semester. Now to the actual update.


I figured that the best way to do a breakable object was to do a custom mesh. That way you have control of all the verticies and can move them as needed. It's a bit cumbersome since you have to write out all the verticies and the rendered triangles manually but I'll figure out a way to semi-automate it later. I managed to create some geometry and to test if I could manipulate it properly I made a quick method that lets you click on the object to move half of the verticies up a bit, but that's when I realised a big problem. The object has a rigid body to make the physics easier, which is fine normally but the problem is that even when the mesh seperates into two objects, they are still treated as the same object by the rigid body.



To combat this I decided that I need to create a recursive class so that when the object splitts in two, it will create two new objects with the new specifications instead of trying to control the entire mesh by itself. I've started on this but havn't figured out all the specifics yet. 

torsdag 7 maj 2020

Startpoint

I want to make a breakable object in unity. I have been looking at some techniques at these places (https://link-springer-com.focus.lib.kth.se/content/pdf/10.1007/BF01900837.pdf ,  https://www.sciencedirect.com/science/article/pii/S0097849314000806 ) and my current toughts are to create my own mesh and manipulate it. I found this tutorial that will help with that. https://www.youtube.com/watch?v=eJEpeUH1EMg