how to create a polygon angle in 3D view?

currently i am able to make a polygon in 2D Ejs view.

but when i try to use the same idea to draw a polygon in 3D view of Ejs, it didn't seem to draw it.

may i request for a sample xml that draw a polygon in 3D view of Ejs?

want i am trying to do is to draw a polygon from vector B (magnetic field direction) to vector A (area) in 3D view.

i also attached my xml in case i am not clear