www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: AGP on January 21, 2014, 04:35:18 am

Title: How to move U/V Coordinates...
Post by: AGP on January 21, 2014, 04:35:18 am
...so as to animate river water? The following doesn't work, for some reason:

Code: [Select]
     public void moveRiverWater(float deltaTime) {
Matrix matrix = river.getTextureMatrix();
if (matrix == null) {
     matrix = new Matrix();
     river.setTextureMatrix(matrix);
}
matrix.translate(river.getXAxis().x*100*deltaTime, river.getXAxis().y*100*deltaTime, river.getXAxis().z*100f*deltaTime);
river.setTextureMatrix(matrix);//WITH OR WITHOUT THIS SEEMINGLY UNNECESSARY CALL, IT DOESN'T WORK
     }

I get absolutely nothing whether or not the object is compiled.
Title: Re: How to move U/V Coordinates...
Post by: EgonOlsen on January 21, 2014, 07:44:11 am
You have to keep three things in mind when using a texture matrix: