Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by DevedGames · Mar 12, 2017 at 03:03 PM · rotationgameobjecttransform

I want to make a Cube surface

Hello, I want to make a cube with different heightmaps on each Side. alt text And thats what i got. Now i want to wrap this like a Cube, but i am not sure how to do this. If i Rotate it manully each face is much more aweay than before. If i ROtate it around a certain Point with script they are spreat all over the place.

 public class Landscape : MonoBehaviour {
     public int width = 128;
     public int depth = 128;
     public int heightScale = 20;
     public float detailScale = 25f; 
 
     public GameObject cube;
     public Transform landscapeMid;
     public Transform landscapeLeft;
     public Transform landscapeLeft2;
     public Transform landscapeRight;
     public Transform landscapeTop;
     public Transform landscapeBottom;
 
 
     void Start(){
         for (int z = 0; z < depth; z++) {
             for (int x = 0; x < width; x++) {
                 int y = 0;//(int) (Mathf.PerlinNoise(x/detailScale,z/detailScale)*heightScale);
                 Vector3 blockPos = new Vector3 (x, y, z);
                 Instantiate (cube, blockPos, Quaternion.identity, landscapeMid);
             }
         }
         for (int z = 0; z < depth; z++) {
             for (int x = -width; x < -1; x++) {
                 int y = 0;//(int) (Mathf.PerlinNoise(x/detailScale,z/detailScale)*heightScale);
                 Vector3 blockPos = new Vector3 (x, y, z);
                 Instantiate (cube, blockPos, Quaternion.identity, landscapeLeft);
             }
         }
         for (int z = 0; z < depth; z++) {
             for (int x = -(2*width); x < -width-1; x++) {
                 int y = 0;//(int) (Mathf.PerlinNoise(x/detailScale,z/detailScale)*heightScale);
                 Vector3 blockPos = new Vector3 (x, y, z);
                 Instantiate (cube, blockPos, Quaternion.identity, landscapeLeft2);
             }
         }
         for (int z = 0; z < depth; z++) {
             for (int x = width; x < (2*width)-1; x++) {
                 int y = 0;//(int) (Mathf.PerlinNoise(x/detailScale,z/detailScale)*heightScale);
                 Vector3 blockPos = new Vector3 (x, y, z);
                 Instantiate (cube, blockPos, Quaternion.identity, landscapeRight);
                 //landscapeRight.RotateAround (landscapeMid.transform.position, Vector3.forward, 90);
             }
         }
         for (int z = depth+1; z < (2*depth); z++) {
             for (int x = 0; x < width; x++) {
                 int y = 0;//(int) (Mathf.PerlinNoise(x/detailScale,z/detailScale)*heightScale);
                 Vector3 blockPos = new Vector3 (x, y, z);
                 Instantiate (cube, blockPos, Quaternion.identity, landscapeTop);
                 //landscapeTop.RotateAround (new Vector3(width / 2, 0, depth / 2),Vector3.forward,90);
             }
         }
         for (int z = -depth; z < -1; z++) {
             for (int x = 0; x < width; x++) {
                 int y = 0;//(int) (Mathf.PerlinNoise(x/detailScale,z/detailScale)*heightScale);
                 Vector3 blockPos = new Vector3 (x, y, z);
                 Instantiate (cube, blockPos, Quaternion.identity, landscapeBottom);
             }
         }
 
 
     }
 
 
 
 }

And this is my code. Iw ould be very Happy if someone could help me. Ps: Sry for my english.

unbenannt.png (69.3 kB)
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

127 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 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 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 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 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 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 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 retrieving transform.position after parent rotation 0 Answers

GameObject not looking at me.. 1 Answer

Clamp without Quaternion? 0 Answers

Canon Ball shooting with Instiate 1 Answer

transform.lookat not working? 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