📜 ⬆️ ⬇️

Creating Isometric Objects for Blender Games



The article will be useful for novice game developers. In it, we will look at the advantages and ways of creating and rendering three-dimensional objects for isometric 2D games using the example of Blender. The article will not have any complicated operations, just a basic knowledge of a 3D editor is enough. For example, rendering and animation, I took the tower from Dune2, and so that it was not so boring alone, I added two buildings from Desert Strike.

The advantages of this approach compared with drawing in 2D : the speed and convenience of creating animations, the ease of upgrading models (for example, to create upgrades for buildings), quite good results at low cost time.

Disadvantages : reducing the "sincerity" of images and, in fact, the need for knowledge of 3D-modeling.
')

Getting started, preparing the scene


By default, an “empty” Blender file is created with three objects: a camera, a light source, and a cube in the center. Let's start the setup from the camera, switch its properties from Perspective mode to Orthographic, then specify the following parameters for it in the Properties panel:

Transform
X: 12.0
Y: -12.0
Z: 12.0

(as you can see, the coordinates are of the form N, -N, N, and N can be any, because we have an orthogonal camera)

Rotation
X: 54.8 °
Y: 0 °
Z: 45 °



If everything is done correctly, then having looked at the scene through the camera (for this you need to press Num0 ), we will see our cube in isometry.

Having tried to render ( F12 ) the first isometric sample, you will see that the edges of the cube are very unevenly lit. Let us make light! First, in the properties of the world (the World tab) we turn on Ambient Occlusion and specify for it the necessary Factor value (in the example set to 0.5). Second, change the type of light source from Point to Sun. This is necessary so that all shadows are directed in one direction and do not depend on the position of the object relative to the light source.


Point render example light source


Sun Render Sample Render

Speaking of shadows, do not repeat my mistakes! If for some reason you want all game objects to be on the same stage and rendered at the same time (for example, not to glue spritesheet from separate images), then make sure that they do not affect each other and their shadows and lighting. (neon signs, lights, etc.) did not overlap other objects. In the image at the beginning of the article it is noticeable that the shadow from the tower falls on the watch tower.

Our cubes are rendered on an ugly gray background, which of course needs to be turned off so as not to suffer then with cutting out the background of objects. To do this, in the Render tab, find the Shading section and change Alpha from Sky to Transparent (if you are using Blender Render) or check the Transparent checkbox in the Film section (in Cycles Render).

With the setting we finished, let's move on to creating objects, for example, the very tower. I think it is not worthwhile to consider in detail the process of its modeling, we will immediately use the very advantages that a three-dimensional object gives us.


The tower spins cheerfully

Many strategies use a visual display of the construction of buildings: first the foundation is built, then the walls, and so on. Let's try to do something like that. Select all the objects in the scene ( A ), then duplicate them ( Shift-D ) and move to the second layer ( M and select the desired layer). The operation can be repeated as many times as we need phases of construction. Let's move to the second layer and “destroy” the tower.


Repeat the required number of times, et voila!



Postprocessing


At the beginning of the article, among the shortcomings of this approach, I mentioned the absence of the feeling of “lamp-like”. Fortunately, it can be partially returned using postprocessing and the Freestyle engine built into Blender. I will not consider it in detail, just show what he is capable of.




Freestyle examples

I hope I proved that the creation of elements for two-dimensional games in the "three-dimensional" in many cases, quick and convenient process. Thanks for attention!

Source: https://habr.com/ru/post/272281/


All Articles