I have a Vector3(x,y,z) and I want to "rotate" (don't know the correct term) on a plane (Y=0).
I got a good result (not that good) if I just update the vector.y value to 0. In that way x, y and z have the good direction but his magnitude is lower (I just made a projection, not the good rotation).
I don't know I'm understood so I made an ugly draw:
Currently I have the orange vector on result, and I want the brown one (who start at the origin)
How can I get the good x and z to get the same vector with y=0 ?

Pseudocode:
Caveat: if
old.x = 0andold.z = 0, it is unclear to which vector on the plane you want to map to. And the pseudo-code above will give division by zero. You will have to deal with that special case separately.