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 /
  • Help Room /
avatar image
0
Question by MorphusTwo · Sep 20, 2020 at 06:49 AM · 3dgridmatrixpoints

3d grid/matrix inside a mesh

Hi All,

I'm trying to create a matrix/grid inside a 3D mesh.

I can create grids, i can create random points inside meshes and colliders, I can even slice the grids using a plane... but I'm having trouble combining the 2.

I'm trying to create an environment where I can get any 3D mesh (Any shape/design/3D file format) and then create a series of 3D points inside it at a given distance from each other.

And obviously only have the points that are inside the mesh, removing the others.

I've looked into Octree and just found out about KDtree but really not sure i need to get that complicated.

Does anyone know how I can achieve this, how would you go about doing this?

Not looking for code or anything, just direction.

alt text

3d-matrix.jpg (180.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

Answer by Bunny83 · Sep 20, 2020 at 03:16 PM

Sorry but I think I'm not really sure what you're actually asking here. A grid is a rather abstract concept. It could be simply snapping points to the closest grid point, it could be about drawing grid lines. This part:

I'm trying to create an environment where I can get any 3D mesh (Any shape/design/3D file format) and then create a series of 3D points inside it at a given distance from each other.

And obviously only have the points that are inside the mesh, removing the others.

sounds more like you're looking for generating point cloud data and / or working on boolean operations (CSG). To me it sounds like you don't really sure what you actually want or that you have trouble explaining it :) Maybe it's just me not understanding it.


KD-trees and octrees are just a way for space partitioning to speed up searching for things inside the tree.


To me it's still not clear if you actually want to work with 3d meshes or if you're just interested in getting the points inside them (for whatever reasons). Since you talked about arbitrary meshes I'd like to note that a mesh in general does not really represent any volume as a mesh only defines the surface. A mesh does not need to be closed. So if you're thinking about CSG there's not always a reasonable way to construct a logical volume out of surface meshes. While the logic behind CSG is relatively simple, implementing them is much harder. When you want to implement boolean operation between 3d meshes there are many edge cases which can drive you mad, believe me :) Under the hood it's just basic geometry / maths / equations.

Comment
Add comment · Show 1 · 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
avatar image MorphusTwo · Sep 21, 2020 at 05:28 AM 0
Share

Apologies if you didn't understand the issue,

I need to create a matrix of points at a set distance from each other inside a mesh.

These points could be local, world or any other coordinates i just need their location programatically...

I want to use these points/coordinates to place prefabs.

EDIT: Imagine Voxel Art in the shape of something, and man, a teddybear, a car, a tree etc.

Think I just answered my own question...

Kindest regards,

Chris

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

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

Related Questions

3D Grid Based Movement 0 Answers

How to check if object is inside another 1 Answer

Destroying an object in a matrix 0 Answers

How do I obtain smooth movement of a 3d object on an int grid? 0 Answers

Point Generator(based on time) 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