WPF, Textures and large images
-
Hi, I just started playing around with the 3D functionalities in WPF and have a problem now: I have a ViewPort3D to which I added a cube. To one side of this cube I have applied a material like this:
MeshGeometry3D plane = new MeshGeometry3D();
Point3DCollection points = new Point3DCollection();
points.Add(new Point3D(p1X, p1Y, p1Z));
points.Add(new Point3D(p2X, p2Y, p2Z));
points.Add(new Point3D(p3X, p3Y, p3Z));
points.Add(new Point3D(p4X, p4Y, p4Z));
plane.Positions = points;
Int32Collection indices = new Int32Collection();
indices.Add(0);
indices.Add(1);
indices.Add(2);
indices.Add(0);
indices.Add(2);
indices.Add(3);
plane.TriangleIndices = indices;
PointCollection texturePoints = new PointCollection();
texturePoints.Add(new Point(0, 0));
texturePoints.Add(new Point(0, 1));
texturePoints.Add(new Point(1, 1));
texturePoints.Add(new Point(1, 0));
plane.TextureCoordinates = texturePoints;ImageBrush brush = new ImageBrush();
brush.ImageSource = new BitmapImage(new Uri(@"C:\test1.jpg"));
DiffuseMaterial material = new DiffuseMaterial(brush);GeometryModel3D result = new GeometryModel3D(plane, material);
Everything work fine with "small" images. I have a supa dupa cube with a clear texture. But if I use images where the width or height has more than 2000 pixels than I see a weird tiled result on my cube. Has anyone here had any problems with large images in 3D WPF? Any hints are appreciated. Robert