I am making a 2D imgage to 3D spatial converter.
The use case is the diamond pickaxe from minecraft from a 16x16.png file to a 3D Spatial.
I have the conversion working but want to know a better way / jmonkey way of loading the image file
Currently I am using this with a hard coded URL
[java]
String IMAGE_NAME = “diamond_pickaxe.png”;
URL url = ImageProcessTestMain.class.getResource(IMAGE_NAME);
BufferedImage bufferedImage = ImageIO.read(url);
…
int width = bufferedImage .getWidth();
int height = bufferedImage .getHeight();
int[][] result = new int[height][width];
for (int row = 0; row < height; row++) {
for (int col = 0; col < width; col++) {
result[row][col] = bufferedImage .getRGB(col, row);
System.out.print(" " + result[row][col]);
}
System.out.println(" ");
}
[/java]
I would like to use something inside of JMonkey that would give me the same data using the assetManager
[java]
Texture texture = assetManager.loadTexture(“Textures/diamond_pickaxe.png”);
…
texture.getData()???
[/java]
Thanks for any help