Viewer API: toggle wireframe and other render modes from API?

(Andrew Leahy) #1

Hi, it would be extremely useful to be able to toggle the existing render options from an API call. Maybe something like...

setWireframe(0..7) - colors plus transparent or setWireframeColor(#112233aa)
setShading('default', 'shadeless', 'demo mode', 'matcap').

I know we can launch in 'demo mode' with the init flag "blending:1"

An initialization/embed flag for the other render options would be useful too.

Cheers, Andrew | Western Sydney University


Yep, it's a good idea. I hope we can implement these methods and URL params in the future.



A setTextureQuality method will be added in our next release so you can switch between LD/SD/HD

(Aleahy) #4

Hi James, did setTextureQuality() arrive in the Viewer API or is it still in the pipeline?



Yes, it was added a while ago, but we forgot to add it to the documentation. That will be fixed next week, but here it is:

setTextureQuality( quality, [callback] )

Sets the texture quality used for all the textures used by the viewer. The quality parameter must be one of the three options: ‘ld’ (low definition), ‘sd’ (standard definition), ‘hd’ (high definition)

api.setTextureQuality( 'hd', function(){
    console.log('Texture quality set to high definition');


You can now edit wireframe and shading in the Viewer API (version 1.4.0)

See: Viewer API Change Log