05-09-2016, 04:12 PM
I have successfully drawn a Model3DFactory.CreateCylinder using an imagebrush using the 'siteoforigin' method for sourcing the image file and it draws the cylinder painted with the image exactly as I expected.
However, when I use the exact same code with the Mesh3DFactory.CreateExtrudedMeshGeometry method, I no longer see my extruded geometry. My code:
If I use a DiffuseMaterial with a solid color, everything draws correctly. Is it possible that ExtrudedMeshGeometry doesn't support an image brush or do I have a syntax error?
However, when I use the exact same code with the Mesh3DFactory.CreateExtrudedMeshGeometry method, I no longer see my extruded geometry. My code:
Code:
private Model3D DrawSegment()
{
GeometryModel3D gm = new GeometryModel3D();
ImageBrush colors_brush = new ImageBrush();
colors_brush.ImageSource = new BitmapImage(new Uri("pack://siteoforigin:,,,/images/image.jpg", UriKind.RelativeOrAbsolute));
DiffuseMaterial material = new DiffuseMaterial(colors_brush);
gm.Material = material;
gm.Geometry = Mesh3DFactory.CreateExtrudedMeshGeometry(_points, isSmooth, modelOffset, extrudeVector, shapeYVector);
return gm;
}If I use a DiffuseMaterial with a solid color, everything draws correctly. Is it possible that ExtrudedMeshGeometry doesn't support an image brush or do I have a syntax error?

