I try to make a script to draw a point cloud where every point is a cube. It work, but the position of every cube is wrong (all along diagonal). Where is the error? I absolutely need the form [x,y,z,x1,y1,z1...] because rhino export in this form and I can't rewrite thousand of point...
var PointDimension = 0.1 ; //dimension of cube
var Pointarray = new Array ();
Pointarray = [1,1,1,2,2,6,3,3,0.1,4,4,4]; //List of coordinate export by rhinoceros.
function Start () {
for (i = 0; i <Pointarray.length/3 ; i++)
{
var cube : GameObject = GameObject.CreatePrimitive(PrimitiveType.Cube);
cube.transform.position = Vector3((i*3),(i*3+1),(i*3+2));
cube.transform.localScale = Vector3(PointDimension, PointDimension ,PointDimension);
}
}