Steve

Steve

  • 0
  • 1
  • 0

WPF GeometryModel3D Texture Mapping

Oct 5 2009 4:28 PM
In DirectX you can use a PositionColored vertex format to set the color of a given primitive. When rendered, the primitive displays the given colors at each vertex and interpolates the fill color based on the color values at each vertex. This is the simple approach. You can also use textured coordinates, supplying an image that contains, for example, a color gradient, to produce a similar result. I have attempted to do the same thing in WPF by supplying texture coordinates for a simple triangle. The MeshGeometry3D instance contains a single triangle (3 points) with texture coordinates that reference the DiffuseMaterial created from an ImageBrush (containing a color gradient bitmap). No matter what I try, the points of my triangle are not what I set and the triangle surface does not fill properly. Any help would be greatly appreciated. Thanks in advance.

Brought to you by: JavaScript SDK for Bold BI dashboard and analytics embedding. Free trial.