SpaceshipGenerator: A Blender script to procedurally generate 3D spaceships

栏目: IT技术 · 发布时间: 4年前

内容简介:A Blender script to procedurally generate 3D spaceships from a random seed.

Spaceship Generator

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

SpaceshipGenerator: A Blender script to procedurally generate 3D spaceships

Usage

  • Install Blender 2.76 or greater: http://blender.org/download/
  • Download newest add_mesh_SpaceshipGenerator.zip from the Releases section
  • Under File > User Preferences... > Add-ons > Install From File... open the downloaded ZIP file
  • Under File > User Preferences... > Add-ons enable this script (search for "spaceship")
  • Add a spaceship in the 3D View under Add > Mesh > Spaceship

How it works

SpaceshipGenerator: A Blender script to procedurally generate 3D spaceships

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.

SpaceshipGenerator: A Blender script to procedurally generate 3D spaceships

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!
  • You can replace the textures with your own ones. All textures are applied using global-space cube UVs. hull_normal.png is a normal map that adds extra surface "greebles". hull_lights_diffuse.png is an additive diffuse texture to set the color of the window lights. hull_lights_emit.png is an emissive texture to make the windows glow in darkness.

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

Special thanks to @panzi for bugfixes, a proper GUI and build script. Also to @mjrthemes for bugfixing.


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Python编程实践

Python编程实践

Jennifer Campbell、Paul Gries、Jason Montojo、Greg Wilson / 唐学韬 / 机械工业出版社华章公司 / 2011-12-31 / 49.00元

Python是当今世界流行的编程语言之一。本书共15章,通过一些短小精悍的交互式Python脚本帮助学生进行练习,并在这个过程中掌握诸如数据结构、排序和搜索算法、面向对象编程、数据库访问、图形用户界面等基本概念以及良好的程序设计风格。本书既是一本注重科学的计算机科学专业教材,也是一本目标明确的Python参考书。 本书语言风格言简意赅,图表丰富,简单实用,是一本优秀的Python入门级读物,......一起来看看 《Python编程实践》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具