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 Ore-sama · Oct 18, 2010 at 04:18 PM · terrainmesheditor-scripting

Level of details in a script-made mesh in the sceneview

Hello everyone,

I'm creating a mesh via script that lies above the terrain and is shown in the sceneview in editormode. I put together a lot of these meshes so the whole terrain is covered. The mesh has the same shape as the terrain. I create it while iterating over the size of the terrain (in integer steps) getting the height via terrain.terrainData.getHeight(x,y) and adding the vector (x,height,y) zu my mesh vertices. In our game, when you move, you don't move continuous but you move always a constant distance. So the terrain contains out of "tiles" and the mesh shall show you these tiles. One feature for the time beeing: when you click on one tile it changes color (via manipulating uv coordinats) meaning the player can't stand on this tile.

There are 2 problems: First, when I zoom out of the sceneview (and my terrain gets smaller) some vertices of my mesh "hide" under the terrain resulting in "holes" in my mesh. When I zoom in the vertices get to their right height and the holes are disappearing. Actually, it's not only zooming. Sometimes the part of the mesh in the middle of the sceneview is alright and at the other places there are hole. Moving within the sceneview shows that always the part in the center is fine and the other parts have holes. And than there are those holes, that don't dissapear at all, no matter how close I zoom them in.

Second, the TerrainData methods getinterpolatedHeight, getInterpolatedNormal and getSteepnes always return 0. I tried it over the range from 0 zo 5 in 0.1 steps, it's always zero.

So my questions are: Have scriptmade meshes in the sceneview something like a Level of Detail? Or has anybody an explenation for this beahaviour? And is there any way I could stop these holes to appear? And why are my methods not returning the right values?

For a better understanding I add 2 screenshots (a green terrain and the mesh has a red texture). Thanks for the help.

Zoomed in: alt text

Zoomed out: alt text

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

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

No one has followed this question yet.

Related Questions

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

How do I test if car is grounded to stop it from driving in mid-air? 2 Answers

Add Detail Mesh at runtime 1 Answer

How would you go about shaping terrain with scripting? (C#) 1 Answer

Trouble Rendering Mesh 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