Hi,
In new to away3d, i like to ask, if there’s a way to trace or get the background color of my mesh object?
Kindly refer on my code below. Thanx.
case AssetType.MESH:
_mesh = new Mesh();
_mesh = evt.asset as Mesh;
_mesh.mouseEnabled = true;
_mesh.addEventListener(MouseEvent3D.CLICK, onMouseClick);
_mesh.addEventListener(MouseEvent3D.MOUSE_OUT, onMouseOut);
_mesh.addEventListener(MouseEvent3D.MOUSE_OVER, onMouseOver);
trace("Mesh: " + _mesh.name);
trace("Submesh:" + _mesh.subMeshes.length);
for each(var sg:SubGeometry in _mesh.geometry.subGeometries)
{
sg.autoDeriveVertexNormals = true;
sg.autoDeriveVertexTangents = true;
}
for each(var sm:SubMesh in _mesh.subMeshes)
{
_material = new ColorMaterial(0xFFFFFF * Math.random());
sm.material = _material;
_mesh.material = _material;
sm.material.lightPicker = _staticLightPicker;
}
break;