WebGL Html template customization

With the WriteWebGL class, we provide a basic html page with Pan/Zoom/Rotate functions, but you can customize it by passing your html template as parameter.

The html template must have some prerequisites:

  • Eyeshot geometry entry point           <!-- EyeshotGeometry -->
  • Eyeshot helper methods entry point   <!-- EyeshotScripts -->
  • Three.js script - revision 68 (you can find it in the attached zip file)

Here following a code snippet that can be used with the attached template.

Mesh box1 = Mesh.CreateBox(10, 10, 10);
viewportLayout1.Entities.Add(box1, 0, Color.Blue);
var box2 = Mesh.CreateBox(10, 10, 10);
box2.Translate(20, 0, 0);
viewportLayout1.Entities.Add(box2, 0, Color.Red);
string path = @"C:\Temp\CustomTemplate\";
var wgl = new devDept.Eyeshot.Translators.WriteWebGL(viewportLayout1, path + "myFile.html", 0.1, false, null, path + "WebGLCustomTemplate.html");
System.Diagnostics.Process.Start(path + "myFile.html"); // runs the html in browser
Have more questions? Submit a request


Please sign in to leave a comment.