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 Jeremy2300 · Feb 26, 2015 at 01:35 PM · meshmesh verticesmesh manipulation

Ideas/Solutions for finding the outside corner points of a mesh

Hey guys,

I've been trying to find a solution to this problem for way too long, and I think I need some other ideas for how to go about it.

I have a Sims style house design tool that I've been working on, and I'm currently creating a Roof Generator. I had picked up the Buildr Plug-in a while back and I'm modifying his roof code, but it requires the corner points of a mesh to work properly.

I was hoping someone might have a solution or idea on how to do this. I was traversing the voxels of each wall piece for outside points, but my solution doesn't work for every case (namely 1 wide walls). So I thought I'd see if some others had ideas on this while I try to rework my current solution.

Here's an example of the current house, with the mesh selected on top that would generate a roof (the roof mesh was disabled in this) on it (it only generates on a specific texture, so you could paint other voxels on that mesh a different on and the roof would generate around them. Except for holes, it just builds overtop of them since the roof algorithms only work for simple polygons. alt text

Edit: I should add, that the corner vertices are all I need. If you were to trace a line along the outside of the mesh, every time you change direction, I need that vertex (in clockwise or counter-clockwise order). So the image provided would have 8 vertices total - usually starting at the top left... just because everything I've written for the game so far does that.

meshexample.jpg (210.9 kB)
Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Jeremy2300 · Mar 06, 2015 at 12:39 PM

I figured this out, mostly, so I thought I'd post my solution here.

Each vertex shown in the image above is 4 points (one for each block - I combine later once the design is permanent), and each point has an on or off boolean.

  • So, I traverse the outside edges (clockwise) storing each relevant block.

  • I then walk through each block stored adding each vertex in a clockwise order (starting vertex is based on the direction traveled to that block) until there's a neighboring block along that edge. Before being added each vertex checks if it's an outside edge based on the other 3 vertices that share that space (more or less, if any are off it's worth adding to the list to check next - but it won't add duplicate vertices).

  • I then walk through each vertex and if the angle to the next vertex from the current one is different than the previous, I store it as a corner.

I'll simplify it more over time, but this works for now. Since I only have 8 directions (multiples of 45 degrees), I figured certain assumptions can be made later to make things a bit easier for this specific use.

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

19 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 avatar image

Related Questions

Create a droplet wave effect using Mesh deformation 0 Answers

make one mesh follow the deformations of the other,adjust mesh to follow deformations of another(cloth, hair) 0 Answers

Problem with setting vertices positions and smoothing groups. 1 Answer

How to generate a track / path mesh using waypoints,How do I generate a track / path mesh using waypoints 0 Answers

Flawed Mesh Manipulation Question! 1 Answer


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