kovacsv / JSModeler

A JavaScript framework to create and visualize 3D models.
MIT License
655 stars 123 forks source link

Canvas Background Attributes #42

Closed TenEightyOne closed 5 years ago

TenEightyOne commented 5 years ago

I'd like to use JSModeler within a web page but I'd like to change the background attributes to another colour. Is there a way of plugging this into the initial call, and if not how would it be done?

Many thanks for your work on this - it's fantastic!

kovacsv commented 5 years ago

Hi,

It's not possible to set it in the initial call, but you can modify it after the Start call:

var viewer = new JSM.ThreeViewer ();
viewer.Start (document.getElementById ('example'), viewerSettings);
viewer.renderer.setClearColor (new THREE.Color (0xff0000));

Hope it helps!

TenEightyOne commented 5 years ago

Thank you very much :)