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 Roelof · Aug 10, 2013 at 10:46 AM · terrainimportheightmap

Controlling height when importing heightmaps

I'm working on a scene and want accurate control over the various measurements. I imported the terrain just nice, but I just found out that it's slightly higher then it should be. However, I only know the max height (set at resolutions) but not the actual height that is imported.

So my question here is: how does Unity convert the color information from the raw file into height information and is there a way for me to check the height at whatever point to ensure the terrain is accurate? I made the map with true colours ranging from [39,39,39] to [252,252,252].

Thanks for the help!

Comment
Add comment · Show 1
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 Roelof · Aug 11, 2013 at 02:42 AM 0
Share

To give some more specific details about the project I'm working on:

I started on an AutoCAD dwg, where I gave the various contour lines colours in the above range. I exported to Illustrator to fill the areas between the lines with the colour of the specific height en then exported to photoshop as tga so I could rasterize it and export as raw to use in Unity. Before importing into Unity I did have to decrease the size to 1024 x 1024 pixels, but I already had the image put on a square image (just added black lines around it) so that it would not be distorted. I checked the regions below for their actual pixel colour in the smaller version and it was as I expected it to be.

In Unity I have several test boxes which I give different heights to check how high my terrain is at several points. The height of the area with the colour [43,43,43] is 14,3, the height of the area with colour [99,99,99] is 36,8 and the height of the area with colour [252,252,252] is 119,38. When putting it into the actual height of the terrain in meters, I would expect the respective areas to have a height of 101m, 129,5m and 206m. Ins$$anonymous$$d (when adding 86 to the above measured values [ie. raising the lot]) I get 100,3m, 122,8m and 205,38m. The first and last are ok (and easily fully rectified) but the middle value is 7m short.

$$anonymous$$morrow I'll test the terrain at other points to see if I can find other areas that don't fit in with the current 'best' resolution (which, for these measurements was set with a max height of 122). But I'm really wondering how these differences came into the scene and how I can check en correct this more easily.

I hope this might help someone to help me out here :)

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Roelof · Aug 16, 2013 at 10:16 AM

After lots of measuring I came up with the following table where 'Real Height' is the height the specific measuring point has in the real world and 'Measured Height' is the height measured in Unity units. For this I used a maximum height in the terrain resolution of 100. For this entire model I've simply viewed Unity units as being in meters.

  • Real Height /-/ Measured Height

  • 101.5m /-/ 11.73

  • 129.5m /-/ 30.09

  • 153m /-/ 48.81

  • 180m /-/ 72.67

  • 196m /-/ 88.67

  • 206m /-/ 97.88

The main problem was that there was no maximum height setting in which the differences between the various real heights equal the differences between the measured points in Unity. As the area between 180m and 196m is the most important in my project, I chose for this setting where the difference between the two real heights equals the difference in Unity in units (=16). However, in this model, it means a difference of almost 10 meters at the lowest level (real height: 129.5m - 101.5m = 28m; measured height: 30.09 - 11.73 = 18.36; 28 - 18.36 = 9.64!).

For now I'll just leave it at this as I have no idea how this difference came into being, I've checked and rechecked the original files in photoshop and I found the colours as I would expect them. If someone should read this and know why these values are so strange, please do respond, I hope to not have this kind of trouble with all my following models. If this still is not enough information for anyone to answer, then I hope someone can respond to tell me what is required still.

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

14 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

Related Questions

Problem with heightmap and terrain height maxing out at 10000, proportions *Solved* 0 Answers

How to use Height Maps 2 Answers

City Engine - Unity: Terrain mismatch 8 Answers

Issue with importing raw heightmaps (made in photoshop) 5 Answers

Photoshop heightmap chunks not lining up 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