How do I do a perspective view transformation in Java? As I understand it there is some magical 4 dimensional matrix I can use which will determine the FOV, Aspect Ratio, and Near and Far viewing distances, but I don't know how to create that matrix.
I'm able to implement a "PerspectiveTransform" in Java, but I see no effect when using the following
double mat[][] = {
{1, 0, 0, 0},
{0, 1, 0, 0},
{0, 0, 1, 0},
{0, 0, 1, 0}};
PerspectiveTransform ps = new PerspectiveTransform(mat);
ps.transform(p1, p1);
ps.transform(p2, p2);
ps.transform(p3, p3);
ps.transform(p4, p4);
I understand the the bottom-most "1" may need to be 1/d where "d" is the distance, but no matter what number I try there I get no effect. Changing the other numbers does have an effect, but I don't know what effect they will have until I try it (and I can't just guess infinitely). I am aware of and was able to get the "quadToQuad" function to work, but again I would have to guess at which "quads" to use.
So I need a resource to explain to me how to come up with the matrix I need based on a FOV, aspect ratio, distance, etc. I've read the pertinent portion of "Interactive Computer Graphics" 5th Ed. by Edward Angel and don't understand it.
What I'm trying to do is convert a bird's-eye-view image into a human-eye-view image. An example of this can be seen when using Google Earth..
thanks