I’m trying to load in an image in to a Picture object. But I want to image to be mirrored on the Y-axis, not flipped.
I really hope someone can help me with this!
I’m trying to load in an image in to a Picture object. But I want to image to be mirrored on the Y-axis, not flipped.
I really hope someone can help me with this!
@robin0165 You have 2 choices:
[java]
DefaultImageRaster raster = new DefaultImageRaster(yourImage, 0);
DefaultImageRaster outputRaster = new DefaultImageRaster(blankImageWithSameWidthAndHeight, 0);
…
for(int x = 0; x < yourImageWidth; x++) {
for(int y = 0; y < yourImageHeight; y++) {
ColorRGBA color = raster.getPixel(x, y);
outputRaster.setPixel(yourImageWidth - x, y, color);
}
}
[/java]
Hope that helps!
Or… just change the texture coordinates of the Picture’ mesh. Or make a Quad yourself and switch the texture coordinates…