Free Support Forum - aspose.com

Converting u3d file to html does not work

Hy,
I am trying to convert u3d file to html by ASPOSE 3D for .NET, but it doesn’t work.
Output I get 3 files, .js file, .a3dw file and .html file.
When I open html page from the web browser, I get a blank page with a .png image with a white background.
I have also enabled the .a3dw mime type on the web server.
This is the code I use for the conversion:

string pathOut = Server.MapPath(".") + @"\demo.html";
string pathIn = Server.MapPath(".") + @"\U3D.u3d";

    // load the U3D file to be converted 
    var document = new Aspose.ThreeD.Scene(pathIn);
    // Create Instance of HTML Options 
    var options = new HTML5SaveOptions();
    // save U3D as a HTML 
    document.Save(pathOut, options);

@umberto.d

Would you please share your sample source file with us so that can test the scenario in our environment and address it accordingly.

Hy,
this is my source code to convert u3d file in html version.

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Aspose.ThreeD;
using Aspose.ThreeD.Entities;
using Aspose.ThreeD.Formats;
using Aspose.ThreeD.Shading;
using Aspose.ThreeD.Utilities;
using System.IO;

public partial class index : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Aspose.ThreeD.License license = new Aspose.ThreeD.License();
license.SetLicense(Server.MapPath(".") + @"\Aspose.3D.NET.lic");
}

protected void btnCrea_Click(object sender, EventArgs e)
{
    lblMessaggio.Text = "";

    string pathOut = Server.MapPath(".") + @"\public\demo.html";
    string pathIn = Server.MapPath(".") + @"\Libreria3D\U3D.u3d";
    
    
    


    // load the U3D file to be converted 
    var document = new Aspose.ThreeD.Scene(pathIn);
    // Create Instance of HTML Options 
    var options = new HTML5SaveOptions();
    // save U3D as a HTML 
    document.Save(pathOut, options);


    

}

}

@umberto.d

Thanks for attaching the code snippet.

Would you please also attach the sample U3D.u3d file so that we can test the code accordingly and share our feedback with you.

U3D.zip (289.5 KB)

Hy, Asad.
This my test file u3d

@umberto.d

While testing the scenario at our side, we received an HTML file which was not blank. Please check attached screenshot and let us know if you obtain similar output? OR it is completely blank?
htmloutput.png (16.2 KB)

Hy,
The result obtained from the conversion is attacheddemo.zip (291.6 KB)

yes i am. no view
files.zip (82.3 KB)

.net core 3.1
windows 10
aspose.3d 20.9.0

In my file I get the same scenario as yours.
So the conversion doesn’t work.
Why does this happen?
I do not understand if your library does not work or if I am wrong in using it

@umberto.d, @chenwei

We have logged an issue as THREEDNET-759 in our issue tracking system for incorrect conversion of .u3d files to .html. We will further investigate the reasons behind this issue and keep you posted with the status of ticket resolution. Please be patient and give us some time.

We are sorry for the inconvenience.

Now what is the way to make HTML display 3D models? Or switch development environment? (mac/java?)

thank you . please !!!

@chenwei

The ticket has been just logged for investigation and we are afraid that we cannot share any feedback or alternate way at the moment. As soon as the ticket is reviewed, we will be able to further comment on the issue. We will post update in this forum thread as soon as the ticket is fully investigated. Please give us some time.

We are sorry for the inconvenience.

@chenwei, @umberto.d

Would you please try using 20.11 version of the API in which we introduced a new renderer.

Hi Asad,
I used the new library 20.11. On the previous file, the rendered rendering was showing small.
I did a test with another .u3d file, which I am attaching to you, and the rendered rendering shows nothing.
The PDF file contained in the “TestFile” folder is the result that should exit the conversion.

When I launch the html page from the browser, this JavaScript error is shown:

"Uncaught (in promise) ReferenceError: cameraNode is not defined at Module.postRun (aspose.3d-2.0.js: 1) Module.postRun @ aspose.3d-2.0.js: 1 async function (async) Module.postRun @ aspose .3d-2.0.js: 1 callRuntimeCallbacks @ aspose.3d-2.0.js: 1
postRun @ aspose.3d-2.0.js: 1 doRun @ aspose.3d-2.0.js: 1 run @ aspose.3d-2.0.js: 1 runCaller @ aspose.3d-2.0.js: 1
removeRunDependency @ aspose.3d-2.0.js: 1 receiveInstance @ aspose.3d-2.0.js: 1 receiveInstantiatedSource @ aspose.3d-2.0.js: 1 Promise.then (async) (anonymous) @ aspose.3d-2.0.js : 1 Promise.then (async) instantiateAsync @ aspose.3d-2.0.js: 1 createWasm @ aspose.3d-2.0.js: 1 (anonymous) @ aspose.3d-2.0.js: 1 "TEST-ASPOSE-07-11-2020.zip (583.7 KB)

@umberto.d

We generated another ticket as THREEDNET-775 in our issue tracking system for this issue. We will further look into its details as well and keep you posted with the status of its correction. Please be patient and spare us some time.

We are sorry for the inconvenience.

The issues you have found earlier (filed as THREEDNET-775) have been fixed in Aspose.3D for .NET 20.12.

The issues you have found earlier (filed as THREEDNET-775) have been fixed in Aspose.3D for .NET 20.12.