Re: A problem with the textures.
Posted by
gouessej on
URL: https://forum.jogamp.org/A-problem-with-the-textures-tp4025533p4025549.html
I have looked at your source code once more, you use the loader for the WaveFront OBJ format. If your model already has texture coordinates, you shouldn't have to set them, just set the texture to the appearance of your Shape3D.
If you don't know whether your model has correct texture coordinates, import it in a modeler (Blender, Wings3D, Art Of Illusion, etc...), use its MTL file during the import to indicate to this modeler which texture you would like to use and view it. If the texture coordinates are wrong or if there is no texture coordinate in your OBJ file, you can edit your model in the modeler and export it as an OBJ file in order to reimport it later with Java3D. You can set dummy texture coordinates in the code too, just use Shape3D.getGeometry() and call setTextureCoordinates() on the returned object.
Java3D API online documentation is here, the public API has not been modified in Java3D 1.6 pre:
http://download.java.net/media/java3d/javadoc/1.5.0/index.htmlIf you need some working examples relying on this API, look at Arabian Flights:
http://arabian.sourceforge.net/I started my own game project about 6 years ago by modifying an existing free open source project ;)
Edit.: I plan to write a tutorial about Java3D 1.6 pre next month.