In my first test of Google O3D, I had a problem: how to display a wireframe object or better said how to change the polygon rendering mode: POINT, WIREFRAME or SOLID. The answer is rather simple: just play with the FillMode attribute of the material’s state. But before playing with the material’s state, you have to create a state and attach it to the material:
var state = g_pack.createObject('State'); g_Material.state = state;
Once done, you’re ready to tweak the FillMode attribute:
state.getStateParam('FillMode').value = g_o3d.State.WIREFRAME;
state.getStateParam('FillMode').value = g_o3d.State.POINT;
state.getStateParam('FillMode').value = g_o3d.State.SOLID;
You can play with the demo HERE.
Thanks to gman for the tip 😉