Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Mesh Real Cutting

Discussion in 'Made With Unity' started by temo_koki, Jan 29, 2011.

  1. temo_koki

    temo_koki

    Joined:
    Jul 14, 2009
    Posts:
    308
    HI everyone, I'm working on cutting script and here is triangles removing demonstration



    now, I'll start working to create second part of triangles and assign rigidbodies, when I'll finish it I want to sell it on unity's asset store.
    please let me know your opinion.
     
    jimthegiant likes this.
  2. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    Very interesting. When you cut something with this, will we be able to have the two parts have rigidbodies? So that we can simulate something like cutting down trees?
     
  3. Armillary

    Armillary

    Joined:
    Dec 16, 2009
    Posts:
    189
    Looks like it would be very useful for melee weapons, not really sure if I'd pay for something like this though.
     
  4. starpaq

    starpaq

    Joined:
    Jan 17, 2011
    Posts:
    118
    You are definitely onto something really good there. Despite the obvious using this script to remove limbs. I wonder if (eventually) you could use the script to simulate destruction. Performing random odd shaped slices across different segments of the rigidbody to break it into pieces. It would prove great for exploding or shattering objects. Good demonstration and I would think it would prove useful in the Asset store.
     
  5. loken

    loken

    Joined:
    Mar 25, 2009
    Posts:
    109
  6. 2dfxman1

    2dfxman1

    Joined:
    Oct 6, 2010
    Posts:
    1,065
    YES. This is what unity is missing.
    And yes, if you can dynamically cut stuff, you can shatter them too with a bit different code.
     
  7. p6r

    p6r

    Joined:
    Nov 6, 2010
    Posts:
    1,158
    WOW ! Fantastic !
    Could you allow 2 ways :
    * cutting + disappearing of some tiles (like on your video !)
    * cutting but all the tiles remain on the scene : so we could make some walls suddenly fall for example !!! Or a character who suddenly breaks like in cartoon movies !?!

    6R
     
  8. Curious

    Curious

    Joined:
    Nov 19, 2009
    Posts:
    334
    I would definitely buy it :D
    For a fair price of course ;)

    Regards
     
  9. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    940
    Cascho01 likes this.
  10. temo_koki

    temo_koki

    Joined:
    Jul 14, 2009
    Posts:
    308
    ok, I can to have options to remove only upper or down tiles, but why do you need this?
     
  11. temo_koki

    temo_koki

    Joined:
    Jul 14, 2009
    Posts:
    308
    yes, this video is only removing demonstration - I think this was important and hard, creating second part will be same logic. I'm working on that now
     
  12. temo_koki

    temo_koki

    Joined:
    Jul 14, 2009
    Posts:
    308
    I want to create that stuff too, but for now I want to finish this and that try to cut animated characters :)
     
  13. temo_koki

    temo_koki

    Joined:
    Jul 14, 2009
    Posts:
    308
    that is possible too, but you need two-sided shader to be visible cutted mesh from inside too. but now I'm doing real-time cutting, it won't be usable in unity's editor. you'll put this script on that object which will be cutting tool(sword, laser, etc.) and it will cut anything which will have collider and will be on cutting layer.
     
  14. AnomalusUndrdog

    AnomalusUndrdog

    Joined:
    Jul 3, 2009
    Posts:
    1,551
    I would pay for something like this. Heck, I'd vote for this to be integrated as an official feature in Unity.

    In the video, I am seeing some lines on cut surfaces. Hopefully that gets fixed.
     
  15. temo_koki

    temo_koki

    Joined:
    Jul 14, 2009
    Posts:
    308
    That lines are for me :), they are debug lines
     
  16. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Any chance of a webplayer version to try, been doing some slicing stuff myself and would be interested in comparing :)
     
    Cascho01 likes this.
  17. temo_koki

    temo_koki

    Joined:
    Jul 14, 2009
    Posts:
    308
    That will be available soon, now I'm doing some paid scripts for one guy and then I'll continue working on this.
     
  18. akurdas

    akurdas

    Joined:
    Jun 20, 2010
    Posts:
    99
    This is amazing. when are you gonna put it on asset store. I would like to purchase it.
     
  19. akurdas

    akurdas

    Joined:
    Jun 20, 2010
    Posts:
    99
    temo_koki - is it fast enough to use it on IOS devices or only for PC and MAC?
     
  20. temo_koki

    temo_koki

    Joined:
    Jul 14, 2009
    Posts:
    308
    I don't know how it will work on IOS, but on that sculpture there was 50 000 triangles and script goes through this 50 000 triangles and removes 27 000(removing sculpture head in video) in 2.5 second, on IOS you won't have 5 000 triangles per object :), so I think it will work
     
  21. akurdas

    akurdas

    Joined:
    Jun 20, 2010
    Posts:
    99
    Thanks for the reply. I was looking exactly something like this... if its possible, can you send me your e-mail address through private message.
    Thanks
     
    Last edited: Jan 30, 2011
  22. ColossalDuck

    ColossalDuck

    Joined:
    Jun 6, 2009
    Posts:
    3,246
    Seems like with a bit of work, you could implement a basic destruction engine with this. This is pretty cool man.
     
  23. 3Duaun

    3Duaun

    Joined:
    Dec 29, 2009
    Posts:
    600
    looks great so far, hope it performs well on iOS
     
  24. p6r

    p6r

    Joined:
    Nov 6, 2010
    Posts:
    1,158
    For example :
    I add a cube stretched to make a wall. Without having to make a wall piece by piece, I could cut it and thorw something on it at runtime and it could be destroyed. Tiles would fall like bricks !?!
    Or for glasses of windows !?!

    6R
     
  25. temo_koki

    temo_koki

    Joined:
    Jul 14, 2009
    Posts:
    308
    yes, that has logic, but I asked you, why do you need to destroy only some parts " * cutting + disappearing of some tiles (like on your video !) "
     
  26. carvrodrigo

    carvrodrigo

    Joined:
    Feb 7, 2011
    Posts:
    6
    Hi temo_koki,

    You script is amazing!

    I have an paid job for you. Like your script, but it's to cut tree (exactly where the user choose).
    Are you able?

    If you have skype (carvrodrigo) or msn (carvrodrigo@hotmail.com) will be better to talk,

    carvrodrigo@gmail.com
     
    Last edited: Feb 7, 2011
  27. p6r

    p6r

    Joined:
    Nov 6, 2010
    Posts:
    1,158
    It can be very interesting to cut some finished models... for example to create ruins or old towns or bridges after war or an explosion... or for a "puzzle" game where you have to find all the tiles of a destroyed model and you have to assemble it again to win !?!
    Or to cut trees as carvrodrigo said !?!

    6R
     
  28. Curious

    Curious

    Joined:
    Nov 19, 2009
    Posts:
    334
    Is it on asset store yet?
     
  29. temo_koki

    temo_koki

    Joined:
    Jul 14, 2009
    Posts:
    308
  30. Vinícius Sanctus

    Vinícius Sanctus

    Joined:
    Dec 14, 2009
    Posts:
    282
    Great work keep it up.
     
    Last edited: Feb 16, 2011
  31. Curious

    Curious

    Joined:
    Nov 19, 2009
    Posts:
    334
    Did you set a release date?
     
  32. temo_koki

    temo_koki

    Joined:
    Jul 14, 2009
    Posts:
    308
    I don't know :)
    If I won't have any paid job, may be in 3-4 week.
    Now I'm working on inner material, if I'll do it, I think there won't be more hard things to do.
     
  33. temo_koki

    temo_koki

    Joined:
    Jul 14, 2009
    Posts:
    308
    I have done inner material changing, here is some pics.
    Now I'll refine algorithm, sometimes it doesn't connects triangles correctly(pic 3), and fix uvs.
     

    Attached Files:

    • $1.png
      $1.png
      File size:
      405.2 KB
      Views:
      1,959
    • $2.png
      $2.png
      File size:
      878.2 KB
      Views:
      2,003
    • $3.png
      $3.png
      File size:
      647.1 KB
      Views:
      2,215
  34. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    I love how is creates a new material after you cut it...this would be awesome to add gore textures to the model after the cut :)
     
  35. temo_koki

    temo_koki

    Joined:
    Jul 14, 2009
    Posts:
    308
    Here is little progress I have done on inner material's UV correcting

     
  36. temo_koki

    temo_koki

    Joined:
    Jul 14, 2009
    Posts:
    308
    here is second piece instantiation demonstration




     
  37. sawfish

    sawfish

    Joined:
    Feb 12, 2011
    Posts:
    314
    I am thoroughly excited about this project. Looking forward to it being on the asset store. :)
     
  38. Vinícius Sanctus

    Vinícius Sanctus

    Joined:
    Dec 14, 2009
    Posts:
    282
    Wow great improvments Temo friend!

    Im looking forward to have some cash to buy it once its on the asset store! =)

    Hugs!
     
  39. temo_koki

    temo_koki

    Joined:
    Jul 14, 2009
    Posts:
    308
  40. RAWTalent

    RAWTalent

    Joined:
    Oct 27, 2010
    Posts:
    32
    That is excellent, reminds me a lot of the wii sports object cutting game :) Keep up the great work.
     
  41. markis

    markis

    Joined:
    Oct 11, 2010
    Posts:
    51
    where can i get this?
     
  42. temo_koki

    temo_koki

    Joined:
    Jul 14, 2009
    Posts:
    308
    I haven't finished it yet, it'll be available on asset store.
     
  43. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Awesome work Temo!!! The watermelon feels just like in Metal Gear Solid :D

    Any chance of putting this on ActiveDen?
     
  44. temo_koki

    temo_koki

    Joined:
    Jul 14, 2009
    Posts:
    308
    no :), they take 75%, unity takes only 30%
     
  45. geyapingcn

    geyapingcn

    Joined:
    Jul 29, 2010
    Posts:
    25
    awesome!!!
    But I have two questions:
    1.when the mesh was cutted,the edges were extruded.
    2. If you can achieve this effect which can cut serveral submesh that contained in a object?like the follow image:
     
    Last edited: May 31, 2011
  46. geyapingcn

    geyapingcn

    Joined:
    Jul 29, 2010
    Posts:
    25
    The Pyramid is not cutting correctly.

    So do the Ball.
     
    Last edited: Jun 6, 2011
  47. U2

    U2

    Joined:
    Aug 12, 2008
    Posts:
    216
    Out of curiosity could you use this to cut a hole in the Unity terrain?
     
  48. temo_koki

    temo_koki

    Joined:
    Jul 14, 2009
    Posts:
    308
    @geyaping
    No, this "mesh real cutting" cuts only straight. The second image isn't done by this system, it is "Object Cutter"(fake slicing) available on asset store.

    @rutecht
    No, it can't :)


    I have other jobs and I'm not working on this now, and the second cause is that I had troubles with money receiving from asset store(I got it 2 months later), now I'm waiting second money transfer and if it'll be done quickly :) I'll start working on this again.
     
  49. geyapingcn

    geyapingcn

    Joined:
    Jul 29, 2010
    Posts:
    25
    The real cut is not so difficult as I thought before. I have realized it on the mesh .But after mesh.RecalculateNormals(), the Normals of the vertices is not right.I;m trying to resolve it.
     
  50. Heko

    Heko

    Joined:
    Jul 25, 2011
    Posts:
    5
    Looks really cool :)
    How does one start coding something like this in Unity? Like modifying the meshes at "low level" etc. I am interested in giving a shot at coding some sort of fracturing/destruction stuff...