Note that those constants have far more precision in them than a float can represent. You only get about 7 decimal digits in a float.
If you really need all that precision (unlikely?), then use double.
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
posted 13 years ago
Here is an output of the exception. That is when I used this line... return new AffineTransform(0.0f,-0.02999f,0.0f,0.99955f,130.0f,288.78218f); I could obviously catch it, but thats like sweeping up rubbish under the carpet, and pretending its not there, I would rather know why I get an exception. Any help is much appreciated. Thanks
java.awt.image.ImagingOpException: Unable to invert transform AffineTransform[[0.0, 0.0, 130.0], [-0.029990000650287, 0.999549984931946, 288.78216552734375]] at java.awt.image.AffineTransformOp.validateTransform(Unknown Source) at java.awt.image.AffineTransformOp.<init>(Unknown Source) at sun.java2d.pipe.DrawImage.transformImage(Unknown Source) at sun.java2d.pipe.DrawImage.copyImage(Unknown Source) at sun.java2d.pipe.DrawImage.copyImage(Unknown Source) at sun.java2d.SunGraphics2D.drawImage(Unknown Source) at sun.awt.image.ImageRepresentation.drawToBufImage(Unknown Source) at sun.java2d.pipe.DrawImage.copyImage(Unknown Source) at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source) at sun.java2d.SunGraphics2D.drawImage(Unknown Source) at sun.java2d.SunGraphics2D.drawImage(Unknown Source) at rubik.Drawer.drawImage(Drawer.java:275)
Well, the numbers you put into your AffineTransform result in a transformation that maps the entire plane into a single line. You can see this because its determinant is zero. This can't be inverted as it isn't a one-to-one mapping. Evidently whatever you were trying to do has a problem with degenerate transformations.
Read the documentation for AffineTransform, especially the getDeterminant() method, for more information.
posted 13 years ago
Excellent, I was thinking it was something like that. Didn't really consider the determinant, but that explains why it says "Unable to invert transform..." Because you can't invert a matrix that has a zero determinant.
I'm basically building a rubiks cube, and it when it loads up, it shows the cube from the front, but also tries to draw 2 of the side faces, which are really just lines, hence the zero determinant,