goodm goodm - 1 month ago 18x
Java Question

Java, fake 3D effect

How to achieve effect like on the pic below using

or something on
? Or any other effect/transform in Java that I can use on

enter image description here


The effect you want to achieve is called Skewing
Take a look at the Skew section @

First of all download the javaxt api. The Image class has a public constructor which accepts BufferedImage as an argument , see below image = new bufferedImage);
    int width = image.getWidth();
    int height = image.getHeight();
    image.setCorners(20, 70,              //UL
                     width-70, 0,         //UR
                     width+20, height-50, //LR
                     50, height);         //LL

setCorners is sed to skew an image by updating the corner coordinates. Coordinates are supplied in clockwise order starting from the upper left corner.