www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: C3R14L.K1L4 on January 06, 2009, 09:37:52 pm

Title: Sliding texture coordinates
Post by: C3R14L.K1L4 on January 06, 2009, 09:37:52 pm
Greetings,

I've been using this API for some days ago and I must say it's quite good, and with a very smooth learning curve. However, I'm having some problems while trying to change the texture coordinates of some Object3D.
I'm adding to the world a simple skybox, with clouds tilled on the faces of the cube, and I want to slide the textures (ie, change their coordinates). I've checked PolygonManager but I don't know how to use it. Any help would be appreciated.

Kind regards,
CK
Title: Re: Sliding texture coordinates
Post by: EgonOlsen on January 06, 2009, 09:45:43 pm
The PolygonManager can be obtained from the object, in this case from your skybox. The manager has a method setPolygonTexture(int polyID, TextureInfo tInf), which can be used to alter the coordinates. Finding the right polyID for the polygons in question and setting the correct u/vs can be a bit of trial-and-error, but for a simple box, it should be pretty easy to find out.