Save 3D Scene as HTML in C#

Overview

This article explains how you can convert 3D files to HTML after loading them into Scene object using C# and covers wide range of topics (considering supported file formats) e.g.

  • Convert 3DS to HTML using C#
  • Convert FBX to HTML in C#
  • Convert STL to HTML in C#
  • Convert U3D to HTML in C#
  • Convert OBJ to HTML in C#

Save 3D Scene as HTML

Aspose.3D for .NET provides Html5SaveOptions class to save a save 3D scene as HTML. When you export the scene into HTML5 file, API will export three files, an HTML file, an Aspose3DWeb file(*.a3dw), and a rendered JavaScript file. In order to export a3dw file only, you can specify Aspose3DWeb as the export type, and reuse the JavaScript file within your own HTML page. The following C# code snippet shows how to save a 3D scene as HTML. 

 python3 -m http.server

Then open it http://localhost:8000/test.html. The web renderer uses WebGL2, you can use https://get.webgl.org/webgl2/ to check if your browser supports it or not.