Texture questions

Hi, i’m considering to choose jme3 framework for a game project, i’ve got just a few questions that reading documentation didn’t anwser:


  • Is there a simple way to load a texture from a HTTP url? i’ve found that texturemanager in jme2 had a textureload(URL file…) method, but assetmanager in jme3 doesn’t.
  • Is it possible to paint an image (as a logo) on a shape? Without texture repetition… like texturing a single face of a cube. Do i have to build a new .j3md material?



    Thanks

If you have an image at http://www.mysite.com/myimg.png

You can load it from a URL like so:

[java]assetManager.registerLocator(“http://www.mysite.com/”, UrlLocator.class);

Texture tex = assetManager.loadTexture(“myimg.png”);[/java]



I am not sure about the second question, do you mean painting the texture on arbitrary objects at run time?

1 Like

For your first question , yes it’s possible, look at this example http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/asset/TestUrlLoading.java



I’m not sure to understand the second question, you want to texture just one face leaving the others untextured?





Edit : erf too slow!!

1 Like