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 1337GameDev · Nov 02, 2011 at 08:03 PM · cameragriddynamicgeneration

game grid generating whle in camera view ? 3d game scene) android

I want to make a grid similar to these pictures:

alt text

alt text

How would i dynamically generate this grid at a certain z (vertical) level? I want to use a texture, unless i can generate it using raycast as different colors and thicknesses (probably using more rays). This is for a 3d scene app for android if that matters.

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 BerggreenDK · Nov 02, 2011 at 08:48 PM 0
Share

whats the plan with the result? just a drawing or is it supposed to move/rotate around? it matters when you choose your solution for this.

avatar image CreativeStorm · Nov 02, 2011 at 08:51 PM 0
Share

What do you mean by dynamically generate?

If you want to create a grid of a certain size you could instantiate it at the needed z level.

i would create a plane with the size of one meter representing one cell of the grid - than scale it and increase the tiling of the material the fit the scale...

hope this helps a bit

4 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by BerggreenDK · Nov 02, 2011 at 08:50 PM

First, the grid. Without amazing colors.

Just draw a grid square in a texture. Then TILE it onto a flat surface. If you use a flat ground, then you can rotate it as you please.

If you need to move the grid, you can either move the ground the same amount as the gridsize and then reset the position OR index into the texture/material itself and add directly to the UV map coords.

The colors could be made with another texture multiplied/added into the same shader.

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 BerggreenDK · Nov 02, 2011 at 08:50 PM 0
Share

I actually use this grid for my holodeck myself.

avatar image
0

Answer by 1337GameDev · Nov 02, 2011 at 10:24 PM

I meant dynamically created as in a non-static game object, because i thought that might eat up resources and would be hard to scale and etc.

A dynamically created item only draws what is in view and creates the desired shape or etc using a function or repeating pattern of code. If i do this i am not sure how to get it to only draw within my camera view (camera can move and rotate) and how to get it to not move with the camera (if i do something based on camera position to get it to only draw in camera fov)

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 BerggreenDK · Nov 02, 2011 at 11:05 PM

2 things:

1) this forum works different than normal forums. you only post Answers if they solve the Question asked or expect/think they will. You can cut/paste your previous answer to your own question (which you can modify/edit)

2) If you use 1 plane with 2 triangles and a mapped texture that has a tiled grid, I dont see how this would eat that many resources? in Unity a camera has a distance it will look. if you keep your groundplane around center of the camera then you will have an endless grid (search for tilebased scrolling on Google) or how to use viewports.

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 rajavamsidhar_gvs · Jun 16, 2015 at 05:38 AM

u can draw with script also..u can get the script in unity3d forum link is

**http://answers.unity3d.com/questions/482128/draw-grid-lines-in-game-view.html**

it will help u..

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Move along grid where facing 1 Answer

Best way to dynamically generate textures? 0 Answers

Setting camera target after I instantiate the gameobject? 2 Answers

Dynamic Camera Help 1 Answer

Dynamic terrain loading on one scene 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