Textures / Xaml to Vertices

Topics: Developer Forum
Feb 4, 2009 at 12:44 PM
Edited Feb 4, 2009 at 3:09 PM
Hi!
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 !?

Thanks,
Tiago Andrade e Silva
Coordinator
Feb 4, 2009 at 5: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 6:26 PM
Hi!
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 ...

Thanks!
Tiago



Feb 4, 2009 at 11: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.