Search Unity

Creating a Square Pyramid

Discussion in 'Getting Started' started by Dirtydog101, May 7, 2018.

  1. Dirtydog101

    Dirtydog101

    Joined:
    May 7, 2018
    Posts:
    11
    Hi, I'm a beginner in unity little experience, I was wondering if any of you guys know how to make a square pyramid code for unity I am going to use it for a project for school but don't know how to yet.
     
    folino9 likes this.
  2. FMark92

    FMark92

    Joined:
    May 18, 2017
    Posts:
    1,243
    What, like a square circle and triangular sphere?
     
  3. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    A square pyramid is a shape that has a square as a base, with four lateral, triangular faces that share a common vertex at the top. This is in contrast to a triangular pyramid that has a 3-sided base, or a triangular prism that has a square/rectangular base with 2 triangular and 2 rectangular lateral faces.

    So I know you were trying to be funny, but the OP wasn't incorrect in their statement, and ideally a person's first post on these forums wouldn't be met with unhelpful, sarcastic responses.

    @Dirtydog101, is the point of your project to generate the pyramid shape through code? Or do you just need the shape as part of a larger project?

    If you just need it in order to do something else, you may be better off creating the shape in a 3D modeling program. I use Blender because it's free. If you have measurements you need, I can even create the shape for you, if you like.

    Alternatively, Unity now includes Pro Builder, which can be used to generate meshes in the editor. I've only tinkered around with it and don't quite have a handle on it, so I'm not sure if it can create a pyramid shape, but I would assume so.

    If you need to generate the shape as part of the project, you'll want to look into procedural mesh generation. I haven't done much of this myself, but a simple mesh like a square pyramid shouldn't be too involved.

    Can you tell us more about what you're trying to achieve here?
     
  4. FMark92

    FMark92

    Joined:
    May 18, 2017
    Posts:
    1,243
    Lu4e likes this.
  5. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    @FMark92 are you trying to imply that you were referring to rectangles laid out in a circular pattern and icospheres when you made your post? And if so, how is that in any way related to what the OP was asking?

    Own your mistakes. You'll look much better for it in the end.
     
  6. Dirtydog101

    Dirtydog101

    Joined:
    May 7, 2018
    Posts:
    11
    I am trying to achieve a square pyramid shape in unity for a bigger project. Thnks for the feedback but dont know much.
     
  7. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,190
    All of the following instructions are assuming you have ProBuilder installed which is now free from the Asset Store.

    Start by clicking Tools -> ProBuilder -> ProBuilder Window. From the window that pops up you want to click on New Shape and then click Build Cube. Once this is done you should have something like the following screenshot.

    Cube.png

    From there you want to click on the Face Selection on the little black toolbar at the top of the scene view window, then click on the top most face of the cube, press the letter "R" or click on the Scale Tool found on the toolbar directly below the menus at the top-left of the editor.

    Face.png

    From there click and drag the center of the transformation gizmo to create the pyramid.

    Pyramid.png
     
  8. Dirtydog101

    Dirtydog101

    Joined:
    May 7, 2018
    Posts:
    11
    thankyou
     
  9. FMark92

    FMark92

    Joined:
    May 18, 2017
    Posts:
    1,243
    Yes.
    I was asking if OP wanted to make a pyramid structure out of cubes.
    Own your false assumptions.
     
  10. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    My bad. I'm not very learned in the field of mathematics, so I might've missed something a more intelligent person would've caught. I'll try to do some research so I can more easily identify the correlation between square pyramids, square circles, triangular spheres, and pyramid structures out of cubes in the future. Any resources you may have to point me in the right direction would be appreciated.

    I apologize for misinterpreting your obviously helpful post as useless trolling, and for inappropriately suggesting that your second post was some sort of asinine attempt to mask your stupidity by providing absolutely irrelevant images that supposedly clarified your initial statement, while in actuality didn't represent the things you said in the slightest.
     
  11. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,190
    I'm not very learned in the field of mathematics either but a quick search turned up the following article and I assumed that's the correct usage of the term "square pyramid".

    https://en.wikipedia.org/wiki/Square_pyramid
     
    Last edited: May 8, 2018
    studentChriso likes this.
  12. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Next time just wait for Ryiah to post something practical, and other people: stop being so bored you need to squint at each other with a terrified newbie stuck in the middle.
     
    samochreno and Lu4e like this.
  13. Dirtydog101

    Dirtydog101

    Joined:
    May 7, 2018
    Posts:
    11
    Haha im not terrified
     
  14. Dirtydog101

    Dirtydog101

    Joined:
    May 7, 2018
    Posts:
    11
    The Pyramid is done
     
    Ithkul likes this.
  15. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,665
    Props to @Ryiah for being helpful as usual :)