Bend a Rectangle plane using unity3d scripting

This is my college project…A image attached here…I want to flip the ears using unity3D scripting in Java??? I tried my level.but,i can’t do it…Please send me a correct code…I attached flip code given below…
Example Image:
[1412-face.jpg*_|1412]

Flip Code:

var twist = 1.0;

var inputSensitivity = 1.5;

private var baseVertices : Vector3;
private var baseNormals : Vector3;

function Update()
{
if(Input.anyKey)

``````//twist -= 10.0 *Input.GetAxis("Horizontal") * Time.deltaTime;
twist -= 10.0 *Input.GetAxis("Horizontal")  * inputSensitivity * Time.deltaTime;

var mesh : Mesh = GetComponent(MeshFilter).mesh;

if (baseVertices == null)
baseVertices = mesh.vertices;
if (baseNormals == null)
baseNormals = mesh.normals;

var vertices = new Vector3[baseVertices.Length];
var normals = new Vector3[baseVertices.Length];
//var i : float =0.0;
for (var i=0;i<vertices.Length;i+=1)
//if(i<vertices.Length)
{
//i+=1;
vertices <em>= DoTwist(baseVertices<em>, baseVertices_.x * twist );_</em></em>
``````

normals = DoTwist(baseNormals, baseVertices_.y * twist );
* }*_

* mesh.vertices = vertices;*
* mesh.normals = vertices;*

* mesh.RecalculateNormals();*
* mesh.RecalculateBounds();*
}
function DoTwist( pos : Vector3, t : float )
{
* var st = Mathf.Sin(t);*
* var ct = Mathf.Cos(t);*
* new_pos = Vector3.zero;*

new_pos.x = pos.xct - pos.zst;
new_pos.z = pos.xst + pos.zct;
* new_pos.y = pos.y;
return new_pos;
_}

public class Bend : MonoBehaviour
{
public enum BendAxis {X, Y, Z};

`````` public float rotate = 90;
public float fromPosition = 0.5F; //from 0 to 1
public BendAxis axis = BendAxis.X;
Mesh mesh;
Vector3[] vertices;

void Start()
{
mesh = GetComponent<MeshFilter>().mesh;
vertices = mesh.vertices;

if (axis == BendAxis.X)
{
float meshWidth = mesh.bounds.size.z;
for (var i = 0; i < vertices.Length; i++)
{
float formPos = Mathf.Lerp(meshWidth / 2, -meshWidth / 2, fromPosition);
float zeroPos = vertices*.z + formPos;*
``````

float rotateValue = (-rotate / 2) * (zeroPos / meshWidth);

zeroPos -= 2 * vertices_.x * Mathf.Cos ((90 - rotateValue) * Mathf.Deg2Rad);_

vertices_.x += zeroPos * Mathf.Sin(rotateValue * Mathf.Deg2Rad);
vertices.z = zeroPos * Mathf.Cos(rotateValue * Mathf.Deg2Rad) - formPos;
}
}
else if (axis == BendAxis.Y)
{
float meshWidth = mesh.bounds.size.z;
for (var i = 0; i < vertices.Length; i++)
{
float formPos = Mathf.Lerp(meshWidth / 2, -meshWidth / 2, fromPosition);_

float zeroPos = vertices*.z + formPos;*
float rotateValue = (-rotate / 2) * (zeroPos / meshWidth);

zeroPos -= 2 * vertices_.y * Mathf.Cos ((90 - rotateValue) * Mathf.Deg2Rad);_

vertices_.y += zeroPos * Mathf.Sin(rotateValue * Mathf.Deg2Rad);
vertices.z = zeroPos * Mathf.Cos(rotateValue * Mathf.Deg2Rad) - formPos;
}
}
else if (axis == BendAxis.Z)
{
float meshWidth = mesh.bounds.size.x;
for (var i = 0; i < vertices.Length; i++)
{
float formPos = Mathf.Lerp(meshWidth / 2, -meshWidth / 2, fromPosition);_

float zeroPos = vertices*.x + formPos;*
float rotateValue = (-rotate / 2) * (zeroPos / meshWidth);

zeroPos -= 2 * vertices_.y * Mathf.Cos ((90 - rotateValue) * Mathf.Deg2Rad);_

vertices_.y += zeroPos * Mathf.Sin(rotateValue * Mathf.Deg2Rad);
vertices.x = zeroPos * Mathf.Cos(rotateValue * Mathf.Deg2Rad) - formPos;
}
}_

mesh.vertices = vertices;
mesh.RecalculateBounds ();
}
}