Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to draw a spaceship with Python and Blender

2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

How to use Python and Blender super simple to draw spaceships, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.

Have you ever seen a 3D modeling operation with Python? Let me show you:

Isn't that awesome? This is Blender, a software that can be modeled with Python.

Blender is a free and open source 3D computer graphics software toolkit for creating animated movies, visual effects, works of art, 3D print models, dynamic graphics, interactive 3D applications and computer games.

Not only that, it also provides an API for Python to interact with Blender, making it possible for Python to model in 3D:

Https://docs.blender.org/api/2.81/

Let's introduce this spaceship project. This is a competition work that the author used to participate in a reddit challenge in June 2016. The principle of realization is not complicated, that is, the hull is built from a cube and random numbers are used to increase the uncertainty of the hull. Then slowly add details to the hull, such as engines, antennas, turrets, lights, and so on.

Project address:

Https://github.com/a1studmuffin/SpaceshipGenerator

Come and build your spaceship.

Here's how to run the project. You need to make the following preparations:

1. Install Blender 2.76 or above:

Https://www.blender.org/download/

two。 Download the author's generated code (that is, the code that has been API debugged with Blender).

3. Load the downloaded code (add_mesh_SpaceshipGenerator.zip, in the form of a compressed package) into blender:

Click Edit in the menu bar-Select Preferences.

Select the Add-ons on the left, then click install to select the compressed package you just downloaded.

3.3 remember to check the plug-in after loading.

4. After returning to the main view, use the shortcut key shift+F5 to enter the 3D view

5. Use the shortcut key shift+A, when the right mouse button will pop up options, select Spaceship in mesh to generate your spaceship!

So, is it handsome enough? Remember to practice and generate one!

Use Python to DIY yourself

If you want to do your own DIY to make the ship more ugly and handsome, that's fine! Unpack the downloaded package and there will be a file called spaceship_generator.py, which is the main model generation code. You can see many of the author's parameter settings in it. It will be a surprise to modify it a little bit.

You can also read the author's source code (not much, only 800 lines) and learn to make a 3D model different from a spaceship!

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report