Game Development Reference
In-Depth Information
FIG 3.2 A texture atlas in Gimp
showing the boundaries of a small
car sprite image.
in the bottom-left corner. Keep this in mind when you are grabbing pixel
coordinates. If your texture appears upside down, it could be because the y
axis is inverted. This isn't a problem, just something that needs to be taken
into consideration in your game scripts.
The coordinates of the bounding box are then used to manipulate the UV values
of a mesh such that only the pixels inside the bounding box appear on the mesh
as its texture. This requires a thorough understanding of vertices and UVs.
While the vertices of a mesh can have any value in 2D or 3D space, UVs are
always specified between 0 and 1.
Unity Hands On
Modifying Mesh UVs for Sprite Mapping
Step 1. Download Chapter Three/ from the Web site. Unzip
and open the project with Unity. Open the scene called isostreet . You will
see an isometric view of a street scene with a number of smaller icons in
the center. The camera is set to orthographic. As we are using only sprites
Search Nedrilad ::

Custom Search