New Face texture bitmap probem [Away3d 3.6]

Software: Away3D 3.x

DigitalVanilla, Newbie
Posted: 20 April 2012 03:52 AM   Total Posts: 9

Hello guys,

I was back from 4.0 to 3.6 because I found it more friendly because my knowledge of 3D is not soo high.

I’m running into a small problem:

I created a function that create, based on points from the user, a freestyle shape polygon. Soo far soo good, I record the mouse coordinates on each click within an array [ [x,y,z], [x,y,z], [x,y,z], ... ] and the function just looks like this one

floorMesh = new Mesh();
      var 
texture:TransformBitmapMaterial = new TransformBitmapMaterial(Cast.bitmap(floorTexture3));
      
texture.repeat true;  
      
texture.scaleX 1;
      
texture.scaleY 1;
      
texture.rotation 0;
      
texture.smooth true;
      
floorMesh.material texture;
      
      var 
face:Face = new Face();
 
      var 
arr:Array = floor_arr[0];
        
      
face.moveTo(arr[0]50.0arr[2]);
      
      for (var 
i:uint 1floor_arr.lengthi++)
        
face.lineTo(floor_arr[i][0]50.0floor_arr[i][2]);

      
face.uv0 = new UV(00);
      
face.uv1 = new UV(10);
      
face.uv2 = new UV(01);
        
      
floorMesh.addFace(face);
        
      
view3D.scene.addChild(floorMesh); 

so, if I set a color material I can see its perfect (scr1), but if I assign a textures bitmap material you can see in scr4 that the polygon has the texture but the shape is cutten at the third vertex. If I add like 15 points, it always stops to create the polygon at the 3rd vertex. I added a wireframe material and I can see that the polygon isnt close, but using colromaterial its closes the shape. I don’t understand where Im making the mistake. Also, how do I know how to se the uvs?

face.uv0 = new UV(00);
face.uv1 = new UV(10);
face.uv2 = new UV(01); 

is there any tutorial somewhere where I can understand this?

10k thanks guys!!

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X