CuttingTools and Textures

May 19, 2011 at 10:54 AM

Hi Guys,


I'm a newbie on Farseer framework and I have a doubt with CuttingTools.

I need to have a polygon filled with a texture and I need to cut it. For now, I can cut  colored filled polygons. But I need to cut polygons with textures.
I'm already use the PolygonTools to get a Polygon from the given texture. It's all ok. But I need to know how can I map the texture vertices  for cuted subparts of the polygon? I'm using the BasicEffects and VertexPositionTexture classes  to draw the Texture.

I will appreciate any help.  

Thanks

Pedro

Developer
May 20, 2011 at 1:14 AM

All you need to do is transform the local points of the polygon into texture space. If the initial points of the polygon already know there texture coordinates, you simply scale the new points (where the cut takes place) into texture space. Texture space is usually from 0-1.