Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11991 Posts in 1587 Topics- by 3508 Members - Latest Member: NevilleKemp

26. May 2012, 04:36:54 pm
Xith3D CommunityGeneral CategorySupport (Moderator: Marvin Fröhlich)XIN Example 5
Pages: [1]
Print
Author Topic: XIN Example 5  (Read 317 times)
jpl
Just dropped in

Offline Offline

Posts: 7


View Profile Email
« on: 26. January 2011, 05:58:58 pm »

Hey all!

I've been trying out some of the examples in XIN and seem to have reached a problem -- example 5 does not work for me. When creating a ResourceLocator, does one need to specify an absolute path, or a relative one? Where should the resources/ directory be placed? I've been placing it within the src/ directory of my project.

On running, at times I get a white cube (no texture applied to it), and at times an exception is thrown and the JVM killed. Here's a stacktrace:

Exception in thread "main" java.lang.NullPointerException
   at Test.createScene(Test.java:99)
   at Test.<init>(Test.java:59)
   at Test.main(Test.java:137)

Apparently the problem lies with this line:

Texture tex1 = ResourceBag.getInstance().getTexture(RES_TEX1);

A NullPointerException is thrown. (I'm sure the file pointed to by RES_TEX1 exists)

Any tips would be greatly appreciated Smiley

J.P.

Logged
ChrisE
Becoming dependent
**
Offline Offline

Posts: 104


View Profile
« Reply #1 on: 26. January 2011, 08:29:25 pm »

Are you using the code from XIN, or a modified version? If so, would you mind posting that as well?

Thanks!
-Chris
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #2 on: 26. January 2011, 09:25:42 pm »

It doesn't matter, whether you specify relative or absolute paths. The URL just needs to point to valid a folder.

I suggest to checkout the xith-tk project. It includes the xin examples and they run out of the box in that project.

Marvin
Logged
jpl
Just dropped in

Offline Offline

Posts: 7


View Profile Email
« Reply #3 on: 27. January 2011, 03:42:55 am »

Cheers Marvin, got it working after looking through a few examples in xith-tk!
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic