1

I modeled and rendered a 3D scene using Marmoset Toolbag and exported it to a Viewer file. This will give me a .mscene file and a html file. All I have to do is to put them in the same folder and open a html file with a browser that has webgl activated and it works. It works using FireFox for example. However, when I wish to load it to my grid in my WPF app, it just says errors, like _ Script error: error in the page's command_ (error message is my translation sorry). Error code: 0. Line: 0, Character: 0. I always say to continue but in the end All I get is a blank page. This is the code I wrote to open it up:

private void ShowDumbbellMethod()
{
    var targetGrid = (parent as BrowseWares).ViewerGrid;
    var viewer = new WebBrowser();

    viewer.Source = new Uri("C:\\Users\\agoston\\Documents\\Visual Studio 2015\\Projects\\HP_hf_shop\\HP_hf_shop\\HTML\\dumbbell.html");

    targetGrid.Children.Add(viewer);

}

The URI points to my project for now.

How to get this to work? All I saw on the internet was webgl with WebControl dated back to 2013.

LJᛃ
  • 7,655
  • 2
  • 24
  • 35
agiro
  • 2,018
  • 2
  • 30
  • 62

1 Answers1

2

WebGL is supported only in IE11 while WPF's WebBrowser control uses IE7 engine by default. But it's possible to make WebBrowser to use the latest engine. Have a look here to know how to do it, please.

Alternatively, you can use CefSharp instead of WebBrowser control.

Community
  • 1
  • 1
Pavel
  • 910
  • 5
  • 6
  • Thanks for the reply. The app will have to run on other machines as well so I can't force everyone to modify the registry. I tried adding the line into the HTML file, but to no avail. Maybe I should try the CefSharp thing – agiro Mar 13 '17 at 19:39
  • Nope, no luck with cef either (or I'm this noob, also possible). Shall I check for other browser plugins? If so, is there a Firefox? That did good when I just opened it up in file explorer. – agiro Mar 13 '17 at 19:56