I’m using Away3D 3.6 since it seems to better match the documentation.
Anyway I’m starting the process of evaluating Away3D for a bunch of upcoming projects. I usually start with just trying some of the basic things I know I need to accomplish. In my case i’m loading a very simple obj model and setting it to some random material that I created.
How do I change the material that is displayed on the model.
//What i'm using now
loader.loadGeometry("Assets/001.obj", new Obj({material: mat} ));
//First thing I tried
loader.material = new ColorMaterial( 0xFFFFFF );
loader.updateMesh( null );
//2nd thing I tried in an event
loader.handle.material = new ColorMaterial( 0xFFFFFF );
loader.updateMesh( null );
//3rd thing, I tried this in the callback when the mesh is done loading
( Loader3D(e.target).handle as Mesh ).material = mat;
( Loader3D(e.target).handle as Mesh ).updateMesh(null);
So what is the correct way to switch the material during runtime?
Thanks in Advance,
Adam