Texturing-an-object-problem

I've created my own basegame extension class. I can now float arround in void with the controls working accordingly. Time to add a box! This works correctly as well, the problem comes when I want to add a texture to it.



I use an URL to specify the location; whenever I give a location where the image is and start the game I get nothing. When I give a false location (and I get that as debugmessage in the console) I get the same untexturised box. To make it more strange, the URL location is exactly the same as used in the training examples. It's not a matter of the image not being found (since he does find them; hence I get now debugmessage that the URL was nonexistant). I have no idea what might be causing this. Im using the following code


 
public class techDemoTest3 extends BaseGame
{
   
      private int width, height, depth, freq;
      private boolean fullscreen;
      private Camera cam;
      protected Timer timer;
      private Node scene;
      protected InputHandler input;
      protected float interpolation;
      
      //public URL monkeyLoc=techDemoTest3.class.getClassLoader().getResource("jmetest/data/images/Monkey.jpg");


   
   public static void main(String[] args)
   {
      techDemoTest3 app = new techDemoTest3();
      app.setDialogBehaviour(ALWAYS_SHOW_PROPS_DIALOG, techDemoTest3.class.getClassLoader()
   

Is jmetest.jar in your classpath?

renanse said:

Is jmetest.jar in your classpath?


I don't have the .jar included but I did include the jmetest folder where the image is located.

Something strange as well in the code in my first post; I've used the the image for my splash screen and to texture so both are redirecting to the same file. Stange thing is, the splashscreen DOES have an image but my box doesn't while they are both trying to use the same file.

either try including the jar or using a class in jmetest to create your URL rather than your test class (eg.  TestSphere.class.getClassLoader()… etc.)

I made a new workspace and download the CVS again and it seemed to work, I have no URL problems anymore.



About the rendering;



       scene.updateGeometricState(0.0f, true);
      scene.updateRenderState();



were missing. Now everything gets the right texture!
I want to thank everyone that replied and tried to help! :)
pascal said:
using another class should not make a difference since all the classes are loaded by the same classloader hierarchy (unless you change this yourself or you are in a application server or similar).


Good point, my bad.