Textures / Xaml to Vertices

Topics: Developer Forum
Feb 4, 2009 at 11:44 AM
Edited Feb 4, 2009 at 2:09 PM
Farseer 2 included a Textures to Vertices function. The demo seems to be for XNA. Can you give us more info on how to use it in wpf /silverlight ?
What is the data parameter ?

//Calculate the vertices from the array

Vertices verts = Vertices.CreatePolygon(data, polygonTexture.Width, polygonTexture.Height);

Any idea on how we could use this or other method to create the geometry for xaml objects !?

Tiago Andrade e Silva
Feb 4, 2009 at 4:21 PM
The texture to vertices functionality works on arrays of texture data. I don't think WPF/Silverlight support extraction of texture data from shapes, but no worries, we do have a solution.

AndyBeaulieu made a Physics Helper for Farseer Physics. Try it out.
Feb 4, 2009 at 5:26 PM
I'm already using Physics Helper :)
I already ported it to WPF and Microsoft Surface. But I had to battle with the difference in hit test between Silverlight and WPF in the creation of the vertices ...
here is the thread about it http://www.codeplex.com/PhysicsHelper/Thread/View.aspx?ThreadId=45089

But things seem to be working now :) just having some issues with differences in WPF from SL ...


Feb 4, 2009 at 10:20 PM
Just for future reference to anyone that needs this help data is the array of texture data gotten from Texture2d.GetData() seen here.