Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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
6
Question by criddle98 · Aug 02, 2013 at 03:52 AM · 3dgravityplanet

Creating 3d planets with terrain and atmosphere

I am having a difficult time thinking about how to create planets that you can walk on that have terrain and an atmosphere. I have tried creating a very large sphere, but find myself falling off after about 45 seconds. Is there another method I could use that would allow me to walk around the planet and not fall off? Also how would I go about generating terrain, and an atmosphere? I'm fairly new to scripting in Unity3d so any help would be great! Thanks!

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 Graphics_Dev · Jan 14, 2016 at 06:39 PM 0
Share

This might help:

https://www.assetstore.unity3d.com/en/#!/content/26165

3 Replies

· Add your reply
  • Sort: 
avatar image
5

Answer by Kos-Dvornik · Mar 03, 2014 at 08:10 AM

Try this procedural terrain tutorials: http://kostiantyn-dvornik.blogspot.com/2014/02/huge-amazing-unity-terrain-tutorial.html

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
1

Answer by aldonaletto · Aug 02, 2013 at 04:26 AM

You can't use the Unity terrain in this case: it's intended to create only horizontal terrains. The planets should be entirely created in a 3D editor like Blender, or you could modify the regular sphere mesh by script, like in the Procedural Examples project.

Anyway, in order to walk over a spherical surface you would need some special code - take a look at the question Walking On Walls, where a rigidbody character can walk over any surface.

Finally: what do you mean by "atmosphere"? Game characters don't breathe, thus they don't need any atmosphere! Do you mean a kind of fog? Or are you thinking about something like the gravitational field in Angry Birds Starwars? This is a totally different thing: this game simulates a gravitational field that only attracts objects that enter its range (and the field really looks a lot like an atmosphere).

Comment
Add comment · Show 4 · 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 criddle98 · Aug 02, 2013 at 01:29 PM 0
Share

Thanks for the great answer! By atmosphere, I meant like clouds and a sky that are different than seen in space. I have a space skybox(black with stars), but when landing on planet, I wanted it to change to a separate skybox that has a sky relative to the planet style

avatar image aldonaletto · Aug 03, 2013 at 01:03 AM 0
Share

A possible solution is to use a skybox material based on the SkyboxBlended shader. This shader blends two different skyboxes: you could assign the space textures to the first set and the planet skybox textures to the second set, and change the _Blend parameter from 0 to 1 when the player approaches the planet surface. Have a specific SkyboxBlended material for each planet, all of them with the space skybox first, and switch the materials when the player is in outer space: since the first set is always the same, changing the material when the player is outside any planet won't be noticed.

Besides this, you could also paint a sphere with the clouds and atmosphere in a semi-transparent fashion and encapsulate the planet, so that the atmosphere could be seen from the outside (when landed, this sphere would become invisible since Unity renders only the outer side).

avatar image ironclutch123 · Oct 18, 2015 at 03:24 PM 0
Share

"Finally: what do you mean by "atmosphere"? Game characters don't breathe, thus they don't need any atmosphere!"

Actually you can make a code so they have to have air to breath, for the atmosphere I would use a trigger....

avatar image Indri-Siberian · Jan 12, 2016 at 02:28 AM 0
Share

yeah but he wants to add the effect of realism who cares if he cant really breathe. It would look unnatural to have a planet with no atmosphere and planets we cant breathe on have atmospheres just made up of different gases he can then incorporate into his game.

avatar image
1

Answer by TySim · Jan 13, 2016 at 06:55 PM

I am not sure if I understand what you are doing, but if it is like what I was trying a while ago, I may have a solution for you. First, you need two separate but similar objects. The world as seen from above, and the world you walk on. The easiest way to do this is to create a huge rectangle "Planet". This is your walk on surface. The top and bottom (poles) would not actually work like they should, but this can be modified by using code to simulate a step that would normally be a short distance to be a large distance on the map, or by modifying the terrain so that when a player is near the pole, a second form of map (rectangle in the opposite direction (90 degrees off from the original) is used.

Second, you create the massive sphere and place the terrain map you have (modified to a jpeg or other graphic and converted to a spherical) as the texture map for the sphere. In essence you are taking the terrain that is flat in the game and making it into a globe when high enough into the air.

This is now where the two different sky boxes come into play. Once a person gets above a certain level, the skybox for the clouds would switch to the star skybox, and the flat would switch to the globe (with perhaps a transparent version of an outside facing globe of the clouds skybox over the planet to still show the clouds.

I hope that makes sense and answers how to accomplish what you are trying to do. I am assuming you want the player in space to see a planet, fly towards it, go through the atmosphere and land on the planet to then interact with it.

Edit: For true realism, if you are using a compass for example, then the poles should be a single block with 4 blocks attached to them as such:

| 1 | 2 | 3 | 4 | | P |

Now when a player is on square P and they go "up" They head north to block 2. When they go "right" they go north to block 3. When they go "down" they head north to block 4. When they go left, they head north to block 1. Conversely, going down from any of the 4 blocks, puts them in block P on which ever side would be connected to that block from above.

When they go right from block 4, they go to block 1, and when they go left from block 1, they go to block 4 The next layer would have more wrapping blocks, offset and linked on the right and left edges etc...

The problem with that approach is that the terrain must be drawn programatically and there would be some artifacts or gaps that you'd have to watch for. So the first part of this post is the best way. I have found that swapping the maps at the 45 degree n/s latitude works best. Again though, it will take some work to make the transition not so notable. I would suggest that as someone gets to the 42 degree latitude that both maps be drawn on top of each other.

Also, forgot to mention that sides, or ends must attach depending on the orientation.

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

19 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

Related Questions

How to make a character walk on a 3D cube planet and a long 3D cube planet using gravity? 2 Answers

3D Planatary Gravity 2 Answers

Adding a force(gravity) to a planet. 0 Answers

how to apply orbit to the player 2 Answers

Implementing FPS view into locomotion planet walk 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