Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

3D Cookie Cutter Effect using Mesh Deformation

Discussion in 'General Discussion' started by iftah, Jan 7, 2022.

  1. iftah

    iftah

    Joined:
    Feb 25, 2014
    Posts:
    16
    Hi Guys,
    I need to create a cookie cutter effect for a new prototype like this one: https://apps.apple.com/us/app/cookie-cutters/id1485539721
    I tried simple mesh deformation like pushing down the vertices under the cutter, but it gave me horrible result, the cut isn't smooth at all, I know I need to manipulate the mesh to make it smooth, but I'am not an expert in mesh programming. Do you guys have any idea or resources that can help me with this or any assets on the store, I searched but couldn't find any. Thank you guys.
     
  2. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,327
    Easy way:
    High density heightmap.

    Harder way:
    A store information in texture, use shaders to cut the cookie and resulting mesh.

    Hard way:
    Investigate implementation of boolean operations on contours. Store cookie as a contour, then when it is being cut, perform bool and create two meshes based on it. This has been implemented in GLU tesselator before, but is not necessarily easy.
    https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluTessBeginContour.xml

    It is highly likely that you'd need to hire someone to make it work.
     
    iftah likes this.
  3. iftah

    iftah

    Joined:
    Feb 25, 2014
    Posts:
    16
    Thanks a lot for your help, I never done this before but I will do some research and experimentation starting with the easy way. I appreciate your help. Thanks.