Hello.
I need to transform image with user defined points.
Can BezierPatch only work using grid ? Or i could make really fine grid so user points could be adjusted to this fine grid ?
In example im trying there is this grid
_patchVerts = [
new Vertex( 150, -150, 0),
new Vertex( 50, -150, 0),
new Vertex( -50, -150, 0),
new Vertex( -150, -150, 0),
new Vertex( 150, -50, 0),
new Vertex( 50, -50, 0),
new Vertex( -50, -50, 0),
new Vertex( -150, -50, 0),
new Vertex( 150, 50, 0),
new Vertex( 50, 50, 0),
new Vertex( -50, 50, 0), //10
new Vertex( -150, 50, 0),
new Vertex( 150, 150, 0),
new Vertex( 50, 150, 0),
new Vertex( -50, 150, 0),
new Vertex( -150, 150, 0)
];
and these nodes
_nodes["patch"] = new Array(
0, 1, 2, 3, 4, 5, 6, 7,
8, 9, 10, 11, 12, 13, 14, 15
);
I try to add smaller grid but get errors :
_nodes["patch"] = new Array(
0, 1, 2, 3, 4, 5, 6, 7,
8, 9, 10, 11, 12, 13, 14, 15, 16 ,17 , 18, 19, 20 , 21 ,22 ,23 ,24
);
private function getVertexs() : Array {
return [
new Vertex( 150, -150, 0),
new Vertex( 50, -150, 0),
new Vertex( 0, -150, 0), //
new Vertex( -50, -150, 0),
new Vertex( -150, -150, 0),
new Vertex( 150, -50, 0),
new Vertex( 50, -50, 0),
new Vertex( 0, -50, 0), //
new Vertex( -50, -50, 0),
new Vertex( -150, -50, 0),
new Vertex( 150, 0, 0),//
new Vertex( 50, 0, 0),//
new Vertex( 0, 0, 0), //
new Vertex( -50, 0, 0),//
new Vertex( -150, 0, 0),//
new Vertex( 150, 50, 0),
new Vertex( 50, 50, 0),
new Vertex( 0, 50, 0),//
new Vertex( -50, 50, 0), //10
new Vertex( -150, 50, 0),
new Vertex( 150, 150, 0),
new Vertex( 50, 150, 0),
new Vertex( 0, 150, 0),//
new Vertex( -50, 150, 0),
new Vertex( -150, 150, 0)
];
}
Am i doing this wrong ? And can i do this without the grid ?