Posts Tagged ‘textured 2d polygon’

I’ve constructed a primitive batch based on the Microsoft and Farseer examples that can apply a texture to a 2D polygon.

Texture configuration properties are stored in the ‘user data’ property in the Farseer Body and Fixture objects.

I use the body position to determine the texture coordinates. This allows you to apply rotation and translation to the texture coordinates based on the body, in addition to the stored properties.

As you can see, the textures can be applied across multiple sub fixtures.