LinearExtrude gives me meshes with holes

Software: Away3D 4.x

Jean, Newbie
Posted: 14 October 2013 03:14 PM   Total Posts: 3

Hi guys,

I’m using LinearExtrude in order to draw 3d polygons from which I have 2d coordinates.

Here are coordinates of a shape representing the letter “C” in 2d space.


var coordinates:Array = [95.451698, 101.077103, 120.203804, 108.398903, 112.624557, 125.225266, 107.420181, 131.775146, 101.272903, 137.082489, 86.255562, 144.113739, 67.681198, 146.457489, 55.650055, 145.454178, 44.740265, 142.444244, 34.951813, 137.427704, 26.284698, 130.404510, 19.190769, 121.642120, 14.123966, 111.406265, 11.084053, 99.696823, 10.070800, 86.513702, 11.089516, 72.611572, 14.145691, 60.353813, 19.239372, 49.740448, 26.370602, 40.771500, 35.161911, 33.643375, 45.236015, 28.551807, 56.593231, 25.496834, 69.233902, 24.478500, 80.288956, 25.278038, 90.255371, 27.676685, 99.133057, 31.674488, 106.921898, 37.271500, 114.467682, 46.484703, 119.858803, 58.996101, 94.589401, 64.628403, 91.128311, 56.421249, 85.231903, 50.145500, 77.350945, 46.162514, 67.939896, 44.834900, 55.207775, 47.188484, 45.128399, 54.249001, 41.298660, 59.685196, 38.563236, 66.579811, 36.375000, 84.743599, 38.530811, 103.893753, 41.225929, 111.054626, 44.999500, 116.605904, 54.916752, 123.726990, 67.422401, 126.100502, 76.887299, 124.591820, 84.930199, 120.065903, 91.225281, 112.301529, 95.451698, 101.077103];

//Extrusion 3D
var vec3D:Vector.<Vector3D> = new Vector.<Vector3D>();
for (var i:int = 0; i < coordinates.length; i+=2)
{
vec3D.push(new Vector3D(coordinates, 0, coordinates[i+1]));
}

var extrude:LinearExtrude = new LinearExtrude(new ColorMaterial(0xff0000), vec3D,LinearExtrude.Y_AXIS, 10, 10,true, 10);

_view.addChild(extrude);


The problem is that it looks like my “C” is not filled. It looks like it is stroked. How can I fill it ? Am I doing something wrong ? Is there a better way to achieve this ?

Thank you !

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X