@pspeed said:
Can you show me code for how you are reading the images when/before you convert them? There may be no need to convert them if you can just read them natively... depending on how fast that is.
"
I basically buffer it in, write it out into a new file, make my material, then pass the info into another method that creates the boxes.
s = s.substring(0, s.length()-2);
BufferedImage i1 = null;
BufferedImage i2 = null;
BufferedImage i3 = null;
try
{
i1 = ImageIO.read(new File(s.concat(“.1″)));
i2 = ImageIO.read(new File(s.concat(“.2″)));
i3 = ImageIO.read(new File(s.concat(“.3″)));
}
catch(IOException e) {}
File f1 = new File(s.concat(“.1.png”));
File f2 = new File(s.concat(“.2.png”));
File f3 = new File(s.concat(“.3.png”));
ImageIO.write(i1,”png”,f1);
ImageIO.write(i2,”png”,f2);
ImageIO.write(i3,”png”,f3);
Material mat1 = new Material(assetManager, “Common/MatDefs/Misc/Unshaded.j3md”);
Material mat2 = new Material(assetManager, “Common/MatDefs/Misc/Unshaded.j3md”);
Material mat3 = new Material(assetManager, “Common/MatDefs/Misc/Unshaded.j3md”);
mat1.setTexture(“ColorMap”, assetManager.loadTexture(f1.getName()));
mat2.setTexture(“ColorMap”, assetManager.loadTexture(f2.getName()));
mat3.setTexture(“ColorMap”, assetManager.loadTexture(f3.getName()));
Node node = multiFace(i,j,mat1,mat2,mat3);
node.rotate(new Quaternion().fromAngleAxis(FastMath.DEG_TO_RAD*-180, new Vector3f(1,0,0)));
n.attachChild(node);
"
This is how I was doing it originally.
Now I want to read the image in, do the imageRaster changes needed, and then if possible internally convert and add the image as a material/asset. Then I want to create my atlas, and then the .J3O object to REUSE. So in reality the only thing I need to save is the .J3O I want to keep, and the images wont really be needed anymore, so saving a bunch of png or jpg files are kind of useless and a waste imo.
EDIT: I found this in the save and load tutorial
“Note that when you save a model that has textures, the references to those textures are stored as absolute paths, so when loading the j3o file again, the textures have to be accessible at the exact location (relative to the assetmanager root, by default the assets directory) they were loaded from. This is why the SDK manages the conversion on the project level.”
So wouldn’t this mean that I would have to save all of the files to readable formats then? I would like to hear what this adapter is, because I couldn’t find anything yet on it.