Back to project page Tilt-snake.
The source code is released under:
Apache License
If you think the Android project Tilt-snake listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.awhittle.tiltsnake; /*from w w w .ja va 2s . c o m*/ public class ShapeTools { public static float[] translateMatrix(float A[], float transX, float transY){ float[] B = A; for(int i=0; i<B.length; i+=3 ){ B[i] = A[i] + transX; } for(int j=1; j<B.length; j+=3 ){ B[j] = A[j] + transY; } return B; } public static float[] scaleMatrix(float A[], float scale){ float[] B; B = new float[A.length]; for(int i=0; i<A.length; i++ ) B[i] = A[i] * scale; return B; } }