Question

Currently i am using Three.js(revision 61) to Load a 3D JSON model into the scene. To get the 3D JSON model i am converting 3d max model > .js file via ThreeJSExporter.ms

So model is loading good but without proper material (don't know why) but i just want to convert the model to wire-frame at runtime, like when i MouseDown the selected object the model converts to its wire frame view and on MouseUp reverse back to its original.

Please Let me know i couldn't able to find a solution yet.

Was it helpful?

Solution

You haven't supplied the code you have, but the thing is about modifying objects material.

Given a mesh (added to the scene already), you can do something like:

// Handler is pseudo, you might have your own
mouseDownHandler(){
   object.material.wireframe = true;
}

mouseUpHandler(){
   object.material.wireframe = false;
}

if nothing happens, then try console.log(object);

And then in Chrome Devtools (or Firefox Firebug) you can see your object tree. You'll see were the 'wireframe' option is. Try modifying it right in your console, it should update instantly

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top