returning a relative Vector?

I have 3 vector3s and I need to get the relative Vector2(from V3 on the orange plane). How can I do this?

alt text

Ok, i just re-read your clarification. Do you mean your plane's normal is your forward vector (red), V2(green) is your local upvector and V3 is an arbitrary vector that should be projected onto this plane? Some kind of head-up-display position?

If that's the case you can just use InverseTransformDirection of your transform and transform the vector3 into local space. Cancel out the z-part to project it to the local x-y-plane, that's all.

edit : Converted my comment into an answer ;)

second edit

If you want to convert the position manually into your own local 2d coordinate system, you need the two axis first. One axis would be your up-vector and the other missing vector your right-vector.

This one can be calculated with the cross-produkt(wiki). Since Unity uses a left-handed-system you have to swap the two vectors to get the right- instead of left-vector.

now you can simply project your desired vector onto those two (normalized) vectors to get the desired x-y coordinates:

// C#
Vector3 forward;
Vector3 up;       // have to be normalized

Vector2 TransformPointIntoPlane(Vector3 aPoint)
{
    Vector right = Vector3.Cross(up, forward).normalized;  // If forward is also normalized you don't have to normalize "right" here.
    // If both of your axis-vectors are normalized you don't have to use Vector3.Project
    // the dot-product is enough:
    return new Vector2(Vector3.Dot(aPoint,right),Vector3.Dot(aPoint,up));
}

Vector3 heading = (target.transform.position - transform.position).normalized;

This should give you the relative direction of one Vector to another. I might have those two terms backwards, I can never keep them straight.