Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Development of the animation of "digging a hole"

Discussion in 'Physics' started by tbutrus, Nov 6, 2023.

  1. tbutrus

    tbutrus

    Joined:
    Jan 19, 2023
    Posts:
    3
    Hi everyone,

    I am trying to create an animation of the action of 'digging a hole' into a terrain. A simple deformation of the terrain/earth during the collision with the Mashine/bucket is enough. Drilling physics does not need to be considered.


    My scene consists of the following parts:

    1) FBX file , representing the terrain. It contains a mesh, and a texture material (attached png)

    2) An excavator, consists of several rigid bodies and joints. The bucket comes into interaction with the ground.
    The bucket consists of several parts. On each part a "mesh collider" is attached. (attached png)


    What is the best approach for developing the animation of the drilling action? Does anyone have a hint?


    Thanks.
     

    Attached Files:

  2. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,857
    You shouldn't use a FBX for the terrain. You need to use a data structure that can be easily deformed as a result of collision detection, and a mesh generally isn't.

    Typical approaches for this are representing the terrain as either a height map (if 2D deformation is enough, that is your terrain can only raise/sink) or voxels (if you need full 3D deformation). Then its a matter of detecting which texels (in a heightmap) or voxels (in voxel-based terrain) are colliding against the machine, and adjust their values accordingly.

    How to actually detect the collision and how to adjust terrain values are completely up to your specific needs. By the looks of it you're just starting out with 3D graphics/physics, if that's the case be warned that this is a pretty advanced task.

    As reference, here's an article detailing how to implement this using heightmaps + particles:
    https://www.researchgate.net/public...ls_for_Real-Time_Simulation_A_Hybrid_Approach
     
    tbutrus likes this.
  3. tbutrus

    tbutrus

    Joined:
    Jan 19, 2023
    Posts:
    3
    Ok, thank you!