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 safvantai · Jul 11, 2013 at 11:37 AM · griddesign

can anyone tell me about making grid manualy

Hi, I am creating one application for android device like making interior design, In that i want some tool like grid that for designing and i can calculate the dimension also please help me about this. Is there any way to create the grid layout please give me answer. I have one texture Grid, that placed on plane but how can i find exact location of coordinate.alt text

layout grid design.png (239.8 kB)
Comment
Add comment · Show 2
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 · Jul 11, 2013 at 01:01 PM 0
Share

I don't understand your question. If you are talking about getting world coordinates of a mouse position, you can use Camera.ScreenToWorldPoint(). Be sure to set the 'Z' parameter of the Vector3 passed to the distance between your camera an your plane.

avatar image safvantai · Jul 12, 2013 at 04:18 AM 0
Share

thanks for reply me. $$anonymous$$y question is how we find the particular grid point? that user can click only on plus sign of the grid. This grid contain tiling 100 * 100. $$anonymous$$eans I want to make clickable on only coordinate of the cell.

alt text

point_on_grid.png (3.1 kB)

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by markedagain · Jul 12, 2013 at 05:00 AM

ok, i wish it was as simple as you would hoped.

there are many ways to do it, but prob the simplest i can think of is , you create a single plane and this plane is 1 of your squares of the grid , u make a prefab out of it, then u simply create it 20 times by 20 times. manually speaking this will take for every, so a small script with 2 loops should do the trick.

i believe there is a few "grid" assets on the asset store but i think they are paid, but i beleive they employ the same system of cloning each little square.

once the square form a grid ( your square should be textured with borders ) u can put OnMouse event onto a script attached to the prefab. like this each tile will know when the mouse is over it.

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

Answer by robertbu · Jul 12, 2013 at 05:01 AM

This is just a calculation problem. Lets say that the grid as 100 x 100 squares which means, including the edges, it has 101 lines. So to make things easy, make the plane 100 units by 100 units. If you are using the build-in plane, then scale it to 10 x 10 (since its default size when at (1,1,1) is 10 x 10). If you are using the CreatePlane editor script, you can just size it to 100 x 100. After resizing move the camera and/or adjust the field of view. Now all the coordinates will be whole numbers...easy to calculate and easy to find the nearest one if required. You could position the plane so that the bottom left corner is at the origin. This would make world coordinates and the coordinates of the intersections the same. If you set the center of the plane at the origin, you will need to offset coordinates by 1/2 the plane width. Note the mouse lives in Screen space, so you will need to use Camera.ScreenToWorldPoint() to find the World coordinate of your plane.

Comment
Add comment · Show 3 · 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 markedagain · Jul 12, 2013 at 05:04 AM 0
Share

ya it took me a few seconds to realize what he asked, this is the catch " I have one texture Grid, that placed on plane"

avatar image markedagain · Jul 12, 2013 at 05:06 AM 0
Share

im thinking with 1 plane, he can always use screen to world coord to get exact spot then create a box there of some sort, but figure actually making a grid is better step to learn first

avatar image safvantai · Jul 12, 2013 at 06:08 AM 0
Share

Thank you very much all of you for replied me. I will try this out.

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

17 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

Related Questions

Size To Grid with Walls 0 Answers

I need a grid to help me model and design things. 4 Answers

What is the best way to create 3D tile based levels in Unity ? 1 Answer

Dynamic Grid - A design problem. 0 Answers

Transform does not move GameObject 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