Creating the buildings
city Project TB2 » Devlog
- The code imports the
cmds
module from Maya, which provides functions for interacting with the Maya API. - The generate City function is defined to generate the city buildings. It uses a
for
loop to create 100 buildings. - Inside the loop, random values are generated for the width, height, and depth of each building using
random.uniform(min_value, max_value)
. Adjust the min and max values to control the size range of the buildings. - Random
x
andz
coordinates are generated to position each building within a specified range. - The
cmds.polyCube()
function creates a cube mesh with the specified width, height, and depth. Thename
argument is set to 'building{}'.format(i) to give each building a unique name. - Finally, the
cmds.move()
function is used to move each building to its randomly generated position.
Overall, this code creates a visually interesting cityscape by generating random buildings with varied sizes and positions using Maya's cmds
module.
city Project TB2
Status | Prototype |
Category | Other |
Author | oakley landing |
More posts
- Day and Night CycleMay 26, 2023
- SnowMay 26, 2023
Leave a comment
Log in with itch.io to leave a comment.