Search Unity

How to make icing on cake ?

Discussion in 'General Discussion' started by unity_bTvBsrlWTyIvXA, Oct 17, 2019.

  1. unity_bTvBsrlWTyIvXA

    unity_bTvBsrlWTyIvXA

    Joined:
    Oct 17, 2019
    Posts:
    1
    Quick question how did they achieve this effect :
    ??
    Its amazing and it has 3 parts in it :
    1)Creating the icing.
    2)Flattening out.
    3)Checking it with the given mesh/Cake.

    I have no clue about how its done but i would to know more about this technique.
    Thanks and cheers :)
     
  2. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    Looks to me like they have an icing mesh which they're adding more verts / segments to. In principle it's pretty similar to a line renderer.

    The spatula is a plane. You can test each vert to see what side of that plane it is on, and what distance away from the plane it is. For every vert on the "wrong" side of the plane, move it to rest on the plane.

    Thinking out loud.. if I were doing this, I think I'd have my target cakes defined as a mesh or point cloud. I'd then do the following:
    1. Identify the surface verts of the user generated cake. I don't care about interior verts.
    2. For each vert on my target cake:
    a. Find the closest surface vert on the user cake.
    b. Check the distance, record whether or not it's close enough.
    c. Check the colour, record whether or not it's close enough.
    3. If enough verts succeed for both position and colour, the player has won.