Как добавить текстуру к 3ds модели в Helix Toolkit - PullRequest
0 голосов
/ 05 мая 2019

Как я могу добавить изображение текстуры в мою модель 3ds?
Текстура выглядит следующим образом: Текстура

В настоящее время я могу добавить к ней диффузный материал,но только когда модель разбивается на несколько GeometryModel3D.

var importer = new ModelImporter();
var model = importer.Load(@"C:\Users\ericr\Desktop\B_787_8.3ds"); // Load Model
DiffuseMaterial material = new DiffuseMaterial(new SolidColorBrush(Color.FromRgb(255, 100, 200)));

ModelVisual3D visual3D;

// convert to geometry model to be able to add materials
for (int i = 0;i <= model.Children.Count -1;i++)
{
      GeometryModel3D geomodel = model.Children[i] as GeometryModel3D;
      geomodel.Material = material;
      visual3D = new ModelVisual3D();
      visual3D.Content = geomodel;
      ShopViewPort.Children.Add(visual3D); // add to viewport
 }
...