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.0, arr[2]);
for (var i:uint = 1; i < floor_arr.length; i++)
face.lineTo(floor_arr[i][0], 50.0, floor_arr[i][2]);
face.uv0 = new UV(0, 0);
face.uv1 = new UV(1, 0);
face.uv2 = new UV(0, 1);
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(0, 0);
face.uv1 = new UV(1, 0);
face.uv2 = new UV(0, 1);
is there any tutorial somewhere where I can understand this?
10k thanks guys!!