Question

I am trying to get the original material that object has and add the directional light that I have in the scene:

protected function onMeshComplete(event:AssetEvent):void {

    if (event.asset.assetType == AssetType.MESH) {
        myMesh = event.asset as Mesh;
        for each (var m:SubMesh in myMesh.subMeshes){
            var mat:MaterialBase = m.material;
            mat.lightPicker = staticLightPicker;
            m.material = mat;
        }
    }

}

As a result, as expected, I have the original material and the directional light. But my problem is that I have some strange lines as on the picture below.

enter image description here

Is it the problem with my code? Away3D code? Or 3D model? Thanks!

Was it helpful?

Solution

As Fabrice Closier has explained to me, the fix is to use repeat:true for material. Here is the full answer he gave:

Its not strange. Its because your model has uv’s values lower or exceeding 0-1. You need to set repeat:true to your material. The lines that you see are the pixels of your map (in this case the default engine bitmapdata) being stretched.

Here is the link.

Thank you, Fabrice, very much!

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