Tutorial Index

Align Meshes To A Custom Spaced Grid

In this tutorial you will learn how to align meshes to a grid of user specified spacing.  This is very useful when building things such as fences, railings, roads, or walls.  Below is an example.

      

The first thing you must do is to make sure that your wall, or whatever object you are using, has a specific width, length and height.  For instance, the wall used in the example above had exact dimensions of 7x20x15 units.  It is preferable to have integer sizes for the mesh since specifying the size of the grid spacing is usually in integer values as well.


Wall model in Milkshape3D

The next step is to specify the size of the grid.  This is done using the following toolbar items.

Enter whatever value suits your purposes.  In this example, a value of 7 will suit our needs since the length of the wall is 7 units.  To active the use of the grid, press the Snap To Grid toolbar button.

NOTE:  When Snap To Grid is enabled, placing a mesh into the scene will automatically align it to the grid.  If a mesh is placed in the scene before the grid is enabled, it may be necessary to change its X, Y and Z values in the Properties View in order to align it properly.

Now that the grid is set, we can place a wall mesh in the scene, copy it and paste another one.  Each time we paste a new wall mesh, we can translate it along the grid and it will "snap" every 7 units.

Also note that the Snap To Grid feature works with Scaling and Rotation as well.  For rotation, enter the number of degrees, not radians, for which to snap rotations.  Scaling is the same as Translation in terms of unit value.

Below is the result of enable the grid and placing wall "pieces" next to each other to form a larger wall.


Copyright 2005 Soconne Inc.

terrain editor world editor terrain heightmap opengl directx game programming C++ terrain generator terrain editor editor farcry games developmen