Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Yoshinat0r · Jan 20, 2014 at 01:59 AM · meshobjectcuthalf

How could I cut a mesh into two pieces with code?

I want to do something that seems to be simple but is proving difficult to find an answer to. All I want is to be able to cut a cylinder mesh straight into two pieces dynamically in real time using code. The cut does not have to be diagonal or anything, I just want it to be a straight cut at the point where the mouse is on the object. I know that there are a lot of assets out there for cutting objects but they are all very complicated and kind of overkill for what i want to do, because I don't require any weird angled cuts, and i also don't want a system like fruit ninja where you drag the mouse to determine the cut. I just want to be able to have a cylinder mesh in my game and click on it with my mouse on certain spots and have it cut straight in half at those locations. This is hard to word and I hope somebody can help me out, because I am just at a loss of where to start with the code.

Thx

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image robertbu · Jan 20, 2014 at 02:35 AM 0
Share

Cutting a mesh can be a difficult thing. Assu$$anonymous$$g there are no texturing issues, it is far easier to replace a single cylinder with two cylinders resized to represent the cut.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by SunnyChow · Jan 20, 2014 at 02:54 AM

I think it will be easiest if you create two chopped model in 3d editor and then replace the original cylinder with them.

Otherwise you will have to do lots of calculation to cut a 3d model to two. Have you written any script to modify mesh? First you have to separate the mesh's vertices into two arrays. Then you have to create the two triangle arrays depending on the original mesh and those new vertices arrays.

Or you can buy plug-in in unity asset store

https://www.assetstore.unity3d.com/#/content/4169

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

18 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Cutting a Mesh Into Smaller Pieces 5 Answers

Detecting the subobject of a mesh 1 Answer

Can I stop my player from coming to a stop when colliding? 2 Answers

Vehicle Parts - Bones or Separate Objects? 2 Answers

Resizing one mesh to fit another mesh. 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges