I'm trying to load my vertices array from assets/model.txt I have OpenGLActivity, GLRenderer and Mymodel classes i added this line to the OpenGLActivity:
public static Context context;
And this to Mymodel class:
Context context = OpenGLActivity.context;
AssetManager am = context.getResources().getAssets();
InputStream is = null;
try {
is = am.open("model.txt");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Scanner s = new Scanner(is);
long numfloats = s.nextLong();
float[] vertices = new float[(int) numfloats];
for (int ctr = 0; ctr < vertices.length; ctr++) {
vertices[ctr] = s.nextFloat();
}
But it does'n work (