Loading snapshot for 3d city issue

hello!

i create a new snapshot (canvas snapshot) , i want to put the picture which has been rendered on the suspensive 3DWorld , but the load time is too lang, so i just want to replace the picture on hand with its reduced picture and put it on the 3DWorld (paused ) . After the picture load complete i will use it to replace the reduced picture. and my question is how should i get the reduced picture???

he code is presented as follows:

int height = viewPort.getCamera().getHeight();

int width = viewPort.getCamera().getWidth();

BufferedImage rawFrame = new BufferedImage(width, height,BufferedImage.TYPE_4BYTE_ABGR);

ByteBuffer byteBuffer = BufferUtils.createByteBuffer(width * height * 4 );

renderManager.getRenderer().readFrameBuffer(viewPort.getOutputFrameBuffer(), byteBuffer);

Screenshots.convertScreenShot(byteBuffer, rawFrame);



I want get a BufferedImage image and it’s size as follows

width = width / 2;

height = height /2;

PS: Please write easy because I’m chinese man and I english very poor…

1 Like

:cry:i really need help!!!

:o

:o

Take a look at http://hub.jmonkeyengine.org/javadoc/com/jme3/app/state/ScreenshotAppState.html



It may not do exactly what you need but I think it might help.