Xith3DTerrainTest and Textures

Hello all.

Does anyone know offhand why Xith3DTerrainTest does not apply the stone.jpg texture correctly? At first, I just assumed it was something with my setup, but after looking at the screenshot of the demo on xith.org, it appears to be lacking texturing even in the screenshot.

I pawed through the source of it and noticed that it sets the path to “.” and “…”. I copied stone.jpg into a separate directory along with the Xith3DTerrainTest.java source file. Upon compiling and running, I get the same results as running it from the Xith3D package (and web start). The terrain looks great, but it lacks texture.

-M

There is related topic

http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=xith3d;action=display;num=1070469523, topic name “Texturing Terrain”. I guess you’ll find more info there.

Yuri

Grrrrrr…

I searched the forums for terrain texture and found nothing! >:(

Thanks!

I started that particular link, but have moved on without finding a solution. :frowning:

The Demo does actually work - it just stretches the image across the entire terrain so you get no detail.

What I need to work out is how to tile each triangle with an image just to get some detail. I’m not experienced in graphics but I assume it would not be a good idea to try to put a huge detailed image over the huge terrain.

So tiling the triangles & then giving each a certain level of detail depending if they are in view, close or a long way away I think is the best way.

[quote]The Demo does actually work - it just stretches the image across the entire terrain so you get no detail.
[/quote]
I’m not certain this is true. At least not on my workstation. I created a few much larger textures (2048, 4096, etc. … this is on Radeon 9800 Pro) and tested them with the Xith3DTerrainTest class. The textures consist of a white square with various red lines splattered on it. None of them seem to load at all. I understand that the code should map a texture from 0,0 to 1,1 and cover the entire terrain. Initially, considering the small size of the stone.jpg texture, I believed that perhaps it was being applied but that the stretching was causing a perceived failure in the texture loading process. Now, however, I believe something else is going on. After loading these larger textures in, I still don’t get any apparent texturing. I simply see terrain with a gradient from dark to light grey.

I have attached a screenshot of what I see. I’d love to see screenshots of the terrain test working with a texture applied. Does anyone have any shots of this working?

http://www.abditory.com/~mwright/xith3dterraintest.jpg

Try a 1pixcel by 1pixcel image (say green) & you should see some colour on your terrain. Then you should have a green terrain - but no detail of course.
This is how I assumed something strechy was taking place somehow. This as far as I got.
It’s the triangles thing I was on about which needs solving to get good terrain like grass, stone, etc…

In the demo if you switch to the line mode & see the triangles - these individually need texturing I think.

I’m probably not being much help, just adding moral support I hope!

[quote]Try a 1pixcel by 1pixcel image (say green) & you should see some colour on your terrain. Then you should have a green terrain - but no detail of course.
[/quote]
Built a 1x1 green jpg and replaced texture call in Xith3DTerrainTest.java with the new image. Still nothing. See screenshot below.

http://www.abditory.com/~mwright/nogreen.jpg