[Solved] com.jme3.texture.image

Hello, I started a thread a coupke of days ago when I wanted to load small portions of images for a textures. Well, i figured that the awt.image images can be broken down into smaller textures so i’ve been looking for a way to convert this to a jme texutre. Anyway, I figured that the texture can be loaded from the com.jme3.texture.image class, & one of the parameters in all of the constructors for this is ByteBuffer. I read up on it & found that it can be used to transfer data across languages & stuff… I think. Would anyone care to tell me what it does in this case? :smiley:



Forgive me, I’m new to java & while many people have taken a university course in programming, I have read a couple of books on java :smiley:



Thanks.

This class converts a Java BufferedImage into a jme image. Maybe it helps to look at it’s code:

http://hub.jmonkeyengine.org/javadoc/com/jme3/texture/plugins/AWTLoader.html



In general, though, if you have all of your stuff already in one image it might be best to use that instead of chopping it up. One texture is better than 100 textures, performance wise.

Thanks, but how could I use 1 texture over 100 different textures? If I had, say, 100 different quads that I wanted to fill with different textures, I could put all the images into one file & chop that up or have 100 different textures. Sorry, you are probably right but I don’t see how :stuck_out_tongue:



(I love Mythruna btw!)

Different texture coordinates for each quad accessing the part of the texture that they want to show. (Thanks, re: Mythruna)

But how can i use texture co-ordiantes with a terrainquad?