Original Post
I'm trying to create a rotation matrix that rotates a quad so that it always faces the cameras viewpoint.
I figured that I need to come up with 3 base vectors, but I guess there's still an error in my code, because the quads show some squeezing as soon as I apply the rotation to them.
This is what the quads look like after transforming (they fly straight upwards).

I can't really explain that squeezing: The quads should still appear to have roughly the same size because their distance to the camera doesn't change that much and thus perspective can't be the cause.
I suspect I'm creating the matrix in the wrong way, but I'm not totally sure. Can anybody help?
I figured that I need to come up with 3 base vectors, but I guess there's still an error in my code, because the quads show some squeezing as soon as I apply the rotation to them.
This is what the quads look like after transforming (they fly straight upwards).

// XNA Code// p.position is the center of the particleMatrix translation = Matrix.CreateTranslation(p.position);Matrix rotation = Matrix.Identity;Vector3 viewUp = new Vector3(0, 1, 0);rotation.Forward = Vector3.Normalize(camera.Position - p.position);rotation.Right = Vector3.Cross(viewUp, rotation.Forward);rotation.Up = Vector3.Cross(rotation.Forward, rotation.Right);// All those vectors have a length of approx. 1float fl = rotation.Forward.Length();float rl = rotation.Right.Length();float ul = rotation.Up.Length();// AddQuad creates the quad and rotates each point by the given matrix// Without the rotation, the quads don't show the mentioned squeezingcreator.AddQuad(rotation * translation);I can't really explain that squeezing: The quads should still appear to have roughly the same size because their distance to the camera doesn't change that much and thus perspective can't be the cause.
I suspect I'm creating the matrix in the wrong way, but I'm not totally sure. Can anybody help?