My final code for rotation. This is part of a script that is a component to my 3dmodel. I called the script ModelBehavior.cs

public void Rotate(float RotateLeftRight, float RotateUpDown)

{

float angleX = Camera.mainCamera.transform.localEulerAngles.x;

float angleY = Camera.mainCamera.transform.localEulerAngles.y;

//Debug.Log(angleX + " , " + angleY);

//Camera's angle at z is not needed.

float percentAngleX = (float)angleX / 90.0f;

float percentAngleY = 0.0f;

float x = 0.0f;

float y = 0.0f;

float z = 0.0f;

if(angleY < 90)

{

//Only worry about x and z for up down

percentAngleY = angleY /90.0f;

x += RotateUpDown * (1 - percentAngleY);

z += RotateUpDown * percentAngleY;

y += RotateLeftRight * (1- percentAngleX);

x += RotateLeftRight * (percentAngleX) * (percentAngleY);

z += RotateLeftRight * (percentAngleX) * (1 - percentAngleY);

}

else if(angleY < 180)

{

percentAngleY = (angleY - 90.0f) / 90.0f;

z += RotateUpDown * (1 - percentAngleY);

x -= RotateUpDown * (percentAngleY);

y += RotateLeftRight * (1- percentAngleX);

z -= RotateLeftRight * (percentAngleX) * (percentAngleY);

x += RotateLeftRight * (percentAngleX) * (1 - percentAngleY);

}

else if(angleY < 270)

{

percentAngleY = (angleY - 180.0f) / 90.0f;

x -= RotateUpDown * (1 - percentAngleY);

z -= RotateUpDown * (percentAngleY);

y += RotateLeftRight * (1- percentAngleX);

x -= RotateLeftRight * (percentAngleX) * (percentAngleY);

z -= RotateLeftRight * (percentAngleX) * (1 - percentAngleY);

}

else if(angleY < 360)

{

percentAngleY = (angleY - 270.0f) / 90.0f;

z -= RotateUpDown * (1 - percentAngleY);

x += RotateUpDown * (percentAngleY);

y += RotateLeftRight * (1- percentAngleX);

z -= RotateLeftRight * (percentAngleX) * (percentAngleY);

x += RotateLeftRight * (percentAngleX) * (1 - percentAngleY);

}

Vector3 relativeUp = transform.InverseTransformDirection(Vector3.down);

Vector3 relativeRight = transform.InverseTransformDirection(Vector3.left);

Vector3 relativeForeward = transform.InverseTransformDirection(Vector3.forward);

rotateBy = Quaternion.AngleAxis(z, relativeForeward)

* Quaternion.AngleAxis(y , relativeUp)

* Quaternion.AngleAxis(x , relativeRight);

newDeltaObtained = true;

}

What the above does is give me a quaternion that allows me to rotate my model by a path traced by my finger reguardless of how I am looking at the model (top, stright, left, right, topright, topleft, and anywhere in between).

DavidBeard please look it over and tell me what you think.

Are you sure. Because this code looks to me as if it would rotate the object around the objects y axis regardless of what angle the camera is at.

Also David your below code suffers from gimble lock if i want to rotate around both x and y.