# SetObjectMeshImage

## Description

Sets an object mesh to use this image when rendering. A mesh can have up to 8 images assigned to it in the texture stages 0 to 7. If you are unsure of which texture stage to use, place the image in stage 0. Texture stages can be used to assign multiple images to a mesh, for example you might put the base (diffuse) texture in stage 0, a normal map in stage 1, and a light map in stage 2. The shader used to draw this object can then combine the various textures into a pixel value to show on the screen. Using an image value of 0 for a particular texture stage removes any assigned image from that stage. Mesh indices are in the range 1 to GetObjectNumMeshes

## Definition

SetObjectMeshImage( objID, meshIndex, imageID, textureStage )

void agk::SetObjectMeshImage( UINT objID, UINT meshIndex, UINT imageID, UINT textureStage )

## Parameters

- objID - The ID of the object to modify.
- meshIndex - The index of the mesh to modify, first mesh is at index 1.
- imageID - The ID of the image to assign to this object.
- texStage - The texture stage to use for this image.