How to fill with tile texture?

Aug 1, 2014 at 6:53 AM
I want to fill a polygon with image (tile).

below is my XAML
         <h:HelixViewport3D Name="viewPort3D" >
            <h:SunLight />
            <ModelVisual3D x:Name="vis3D">
            </ModelVisual3D>
         </h:HelixViewport3D>
below is my code
            var mb = new MeshBuilder(false, true);

            IList<Point3D> pnts = new List<Point3D>();
            pnts.Add(new Point3D(0, 0, 0));
            pnts.Add(new Point3D(100, 0, 0));
            pnts.Add(new Point3D(100, 100, 0));
            pnts.Add(new Point3D(0, 100, 0));

            mb.AddPolygon(pnts);

            var mesh = mb.ToMesh(true);

            ImageBrush brush = new ImageBrush();
            brush.ImageSource = new BitmapImage(new Uri(@"C:\box.jpg"));
            brush.TileMode = TileMode.Tile;
            brush.ViewportUnits = BrushMappingMode.Absolute;
            brush.ViewboxUnits = BrushMappingMode.Absolute;
            brush.Stretch = Stretch.None;
            brush.AlignmentX = AlignmentX.Left;
            brush.AlignmentY = AlignmentY.Top;
            brush.Viewport = new Rect(0, 0, brush.ImageSource.Width, brush.ImageSource.Height);
            DiffuseMaterial mat = new DiffuseMaterial(brush);

            GeometryModel3D gModel3D = new GeometryModel3D { Geometry = mesh, Material = mat };

            vis3D.Content = gModel3D;
The above code doesn't work. What I missed in this?
Aug 1, 2014 at 8:12 AM
This is the output window I am getting
Image

below is the box.jpg
Image
Aug 14, 2014 at 4:53 AM
I have found the solution and the detailed code is available here
http://uselesstechnical.wordpress.com/2014/08/14/helix-3d-toolkit-tile-texture/
Marked as answer by veerammalkumaran on 8/13/2014 at 9:53 PM