神刀安全网

Spaceship Generator

Spaceship Generator

A Blender script to procedurally generate 3D spaceships from a random seed.

Spaceship Generator

Usage

  • Install Blender: http://blender.org/download/
  • Open a Text Editor view
  • Press Alt + O , or go to Text > Open Text Block and open spaceship_generator.py
  • Press Alt + P or click Run script

How it works

Spaceship Generator

Watch on YouTube: https://www.youtube.com/watch?v=xJZyXqJ6nog

  • Start with a box.
  • Build the hull: Extrude the front/rear faces several times, adding random translation/scaling/rotation along the way.
  • Add asymmetry to the hull: Pick random faces and extrude them out in a similar manner, reducing in scale each time.
  • Add detail to the hull: Categorize each face by its orientation and generate details on it such as engines, antenna, weapon turrets, lights etc.
  • Sometimes apply horizontal symmetry.
  • Add a Bevel modifier to angularize the shape a bit.
  • Apply materials to the final result.
  • Take over the universe with your new infinite fleet of spaceships.

Extreme examples

The following screenshots were created using extreme values for the number of hull segments and asymmetry segments to show how the algorithm works.

Spaceship Generator

Tips and Tricks

  • By default the script will delete all objects starting with Spaceship before generating a new spaceship. To disable this feature, remove or comment out the call to reset_scene() around line 735 in the main function.
  • You can provide a seed to the generate_spaceship() function to always generate the same spaceship. For example, generate_spaceship('michael') .
  • The generate_spaceship() function takes many more parameters that affect the generation process. Try playing with them!

Credits

Written for fun as part of the /r/proceduralgeneration June 2016 monthly challenge .

Released under the MIT License .

Authored and maintained by Michael Davies.

GitHub@a1studmuffin Twitter @butterparty

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » Spaceship Generator

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址