title: Drawing 3D polygon on unity 3d
body: <p>I am trying out unity for a project that i am on. </p>
  
  <p>I am attempting to draw 3D polygon from a set of coordinate that I have. </p>
  
  <p>So what i am doing now is to build a row of cube btw the two points. I plan to build these points into either a solid shape or just "walls" to form a room. 
  However, it doesn't seem to work as expected. Please advise. </p>
  
  <pre><code>drawCube( Vector3(10,0,14),Vector3(70,0,14)); 
  drawCube( Vector3(90,0,14),Vector3(60,87,45));   
  
  function drawCube(v1,v2) { 
  
  
  
  pA = v1; 
  pB = v2;
  var plane : GameObject = GameObject.CreatePrimitive(PrimitiveType.Cube);
  
   var between:Vector3 = pB - pA;
      var distance:float = between.magnitude;
  plane.transform.localScale.x = distance;
  plane.transform.localScale.y=10;
  plane.transform.position = pA + (between / 2.0);
  plane.transform.LookAt(pB);
  
  }
  </code></pre>
  
  <p>updated: I have also tried using a mesh but all i got was the below image. What am i doing wrong?  </p>
  
  <p>I am trying to achieve something like this </p>
  
  <p><a href="https://i.stack.imgur.com/4WJY3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4WJY3.png" alt="enter image description here"></a></p>