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 erfan · Jul 02, 2014 at 11:29 AM · meshgridvertexhex

Creating Hex Grids from Mesh Vertexes

Hello. I have a mesh. and I want to detect or create a Hex mesh from it's vertex. I mean that I want to select some vertex from my mesh then create a Hex mesh from them. for me Hex mesh can be a single mesh or an object that created from 6 line. both is good for me . how can i do this?

this is concept that i want :somting like this ( but more careful hex )

alt text

Comment
Add comment · Show 4
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 Owen-Reynolds · Jul 02, 2014 at 03:59 PM 0
Share

Why do you want to make it from an existing mesh? Seems like it would be easier to just make it from scratch.

But, it will be just a flat plane -- no one will see the hex-shapes blue lines. Only change will be wiggly edges. The entire point of the plane in that picture is to look like hills and bumps, while hiding that it's really just a bunch of squares.

Using a texture might be better. I feel like there are answered Q's here about "how do I make a hex grid."

Or, put differently, might be better to start with the end result -- the way it should appear -- then think about how to do it.

avatar image robertbu · Jul 02, 2014 at 05:04 PM 0
Share

It is unclear what you want to do here. If the hex mesh does not need to align with the vertices of the underlying mesh, then you can:

  • Pick a center point for the hex.

  • Generate the six corners of the hex on the XZ plane using the center point.

  • Use either raycasting or Terrain.SampleHeight() (if it is a terrain) to set the 'y' height of each vertex.

To get interlocking hexes, just move the center point in a hex fashion and walk a grid above your terrain. It is unclear here if you want multiple hexes meshes, or a single mesh with multiple hexes in that mesh. If it is the latter, you have to decide if you want to share vertices in the mesh.

avatar image erfan · Jul 03, 2014 at 11:00 AM 0
Share

I can't use Texture ! I want to able to click on each mesh. I want $$anonymous$$ultiple hexes meshes . I Want some thing like this : alt text

or

alt text

avatar image KurtGokhan · Jul 03, 2014 at 12:04 PM 0
Share

You may want to change your approach. Your hex grid can not be aligned with squares on the underlying mesh. You may notice on the first image you posted, hex's edges are not of the same length. As robertu suggested you can create vertices from scratch. Look on the subject of procedural mesh generating.

0 Replies

· Add your reply
  • Sort: 

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Hex grid Help, Move from Cartesian coordiantes to slanting one axis along the hex diagonal 0 Answers

Find centres of the sides of a Hexagonal Mesh in UnityScript? Possible? 1 Answer

Why vertex positions appear (0.0, 0.0, 0.0) ? 1 Answer

Vertex colours not blending across triangle face 1 Answer

minimize vertex artifacting for procedural mesh manipulations - vertex collision same object? 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