BufferedImage -> rotate,scale,translate -> BufferedImage


I want to use JME3 to transform bufferedImage and get the result as bufferedImage. I don’t want to display the result. Just want to use JME3 as a convenient wrapper over openGL. Can anyone point me to a sample code which can help me achieve just that?



I’m not sure jME is the right tool for that but I’ll let you decide.
Maybe you should look at ImageRaster or ImagePainter classes.
You’ll have to do the transformations yourself but that’s not that complicated.

Edit: note that ImagePainter is in a plugin

Best regards,

Thanks for the fast reply…
I’m not sure that my question was clear enough…
I want to create a Picture object from BufferedImage :

Image jme3Image = new AWTLoader().load(bufImage, true);
Texture2D texture2D= new Texture2D(jme3Image);
Picture pic = new Picture(“TexturePicture”);
pic.setTexture(assetManager, texture2D, false);

Make some transformation on it :
pic.rotate(0.5f, 0.5f, 0.5f);

and render it by adding it to the scene graph


Now I want to fetch the result… How do I do that?
In addition, I don’t need visualize the result. No need for SimpleApplication. Maybe just create a renderer and use it - something like that. Are there any examples of usages like that for JME3?

Thanks in advance,


So, I’m not trying to be mean, but translating your question I get: “I want to use JME to do this thing but I don’t want to use 98% of JME… I just want JME to get in the way of direct access to lwjgl…”

You are probably better of going to lwjgl directly… though frankly what you want to do would be trivially done in Java code without involving OpenGL at all. So it might be a good idea to address that requirement also as it may affect the answer.

pspeed is right : the tool is wrong.

bad tool = pain and suffering.

I know that it might look like I’m trying to misuse JME and maybe I am…
Just to give the bigger picture - I’m trying to extend the SVG ( Scalable Vector Graphics) image format to support 3D.
I’ll try to ask it in a different way.
I want to build a scene graph, render it (using GPU) and get the result. Even if the tool is wrong. Can it be done with it?



Look at TestRenderToMemory

Thanks!! - that was really helpful. Just what I needed.