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 Chronicler · Mar 12, 2013 at 01:54 AM · meshvoxelremove

Is it possible to remove part of a mesh?

I looked around at previous answers and most of them seemed to say that its possible, but improbable.

I'm currently in the design stage (I haven't coded anything, just figuring out what TO code), but I'm creating a 3-D Liero game. Essentially, I'll have a big cube of dirt (implemented voxel style) with a couple of worms blowing their way through it. My original idea to implement the terrain was that whenever a voxel was destroyed it would call on its neighbors, if they were there, to create a mesh face and then join that face to the larger "terrain" mesh in order to help performance via Mesh.CombineMeshes (nothing says bad fps like 10000 meshes). I'm not going to bother with diagonals or anything, and it should look blocky (kinda like minecraft, but with much much smaller cubes).

The problem is that when I remove a voxel I'll also have to remove any faces that it had previously generated. It wouldn't be hard to locate all the potential vertices, and triangles, that it could have created. So using that is it possible to remove those vertices (and their potential triangles) from the overall mesh? If so, how? What functions would I need and what data?

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 Fattie · Mar 12, 2013 at 07:15 AM 0
Share

Of course, anything's possible.

You will have to become an expert, generally, at program$$anonymous$$g mesh.

if you look in the Documentation you can find the mesh class and proceed from there.

There are dozens or hundreds of questions on here about different aspects of generating mesh.

http://answers.unity3d.com/questions/315059/how-to-improve-performance-while-generating-extrud.html

Realise too there are a number of "unity $$anonymous$$inecraft starter kits" kicking around that have huge code bases and you would certainly start with one of those.

This question is too general so if you have a specific question, ask a new one! Cheers!

'What functions would I need and what data?" the literal answer is glance at "$$anonymous$$esh" in the unit documentation, you will see the .vertices functions and so on.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Eric5h5 · Mar 12, 2013 at 07:24 AM

The standard method is to build mesh chunks, and rebuild them as necessary. Don't use Mesh.CombineMeshes; that adds an unnecessary layer of inefficiency. So you don't need to track vertices or anything, just rebuild the relevant chunk when the player removes or adds a voxel.

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

12 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

Related Questions

Voxel Mesh has Lines Between the Voxels 1 Answer

CombineMeshes() Not Working Properly? 0 Answers

Custom shader light blending 0 Answers

Marching cubes problem, some tris not drawing properly 2 Answers

Colored Voxel Meshs 2 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