Texturing Object3D objects made using addTriangle() method

Started by AcidBurnz, January 07, 2008, 05:35:55 AM

Previous topic - Next topic

AcidBurnz

In the map editor we're working on, the terrain is loaded via heightmaps (binary file) and inserted into an instance of Object3D called terrain via the addTriangle method. Now in order to texture it, I've followed exactly how the 3ds terrain was textured in the car benchmark demo source (Cartest.java). The texture itself is a 128x128 jpg, and it's being loaded fine. I've added it to the texture manager, then added the texture to the terrain via setTexture method. Still nothing is happening.

My guess is that it has something to do with texture coordinates? Is it even possible to texture a mesh created with addTriangles? Thanks for the help in advance.

http://pastebin.com/m849de17 <-- HeightMap.java
http://pastebin.com/m1d208e45 <-- MapEditor.java (contains main method)

ps- I deleted my other thread by accident, the one about camera vectors, is it possible to bring it back?  :o

EgonOlsen

addTriangle(...) exists as a variant that takes texture coordinates, either directly or via a TextureInfo. Without that, the coordinates are always 0/0, which is why setting the texture via setTexture has no or at least not the desired effect.

Sorry about the deleted thread, but there seems to be no way to get it back. At least i can't find one in the forum's admin section.

AcidBurnz

Thanks for the quick reply. I'll attempt using that info, and post back with my findings :D

Cheers!