MeshGeometry3D上的默认纹理坐标

是否可以(不循环遍历所有纹理坐标)将它们默认设置为0?

我正在创建线性渐变ImageBrush

var colorBitmap = getcolorsBitmap(gradient.ToList()); // Create Colors from gray to my selected color
        ImageBrush ib = new ImageBrush(colorBitmap)
        {
            ViewportUnits = BrushMappingMode.Absolute,Viewport = new Rect(0,1,1) // Matches the pixels in the bitmap.
        };
myModel.Material = new DiffuseMaterial(ib);

然后根据条件,我像这样自定义一些Texturecoordinates坐标,其中colorvalue是距对象的距离:

var mesh = (MeshGeometry3D) myModel.Geometry;

//In a loop,depending on the distance I set a colorValue
mesh.TextureCoordinates[count] = new Point(colorValue,0);

我希望每个纹理坐标默认为Point(0,0),但是如果我必须遍历所有120万个坐标,则会花费太多时间。那么有没有办法设置我的ImageBrush,使它们默认为0,0或类似的值?

gn666 回答:MeshGeometry3D上的默认纹理坐标

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3160149.html

大家都在问