Hey Guys,
I know there are many topics on this theme but i am not getting it to work
I try to load a .ser object with texture
Texture th= new Texture(masterContext.getResources().openRawResource(R.raw.th));
TextureManager tm = TextureManager.getInstance();
if(!tm.containsTexture("teppichHems.JPG")){
tm.addTexture("teppichHems.JPG", th);
}
i keep getting the error: unsupportedTextureWidth: 254
i know there is a way to rescale it with a bitmap
but is there another way ?
if not can sombody explain to me how to use a bitmap i never did that before
the code for serializing the object is here i got it from an tutorial i think it works fine no errors here
public static void main(String[] args) {
if(args.length > 3){
int last = args.length - 1;
for(int i = 0; i <= last; i++){
if(args[i].equals("-i3ds")){
if(i == last){
System.err.println("Error missing parameters! "
+ usageMessage);
System.exit(-1);
}else{
objName += args[i + 1];
}
}else if(args[i].equals("-t")){
if(i == last){
System.err.println("Error missing parameters! "
+ usageMessage);
System.exit(-1);
}else{
int k=i;
textureFileName = new String[last-k];
for(int j=0; j<textureFileName.length;j++){
textureFileName[j]="";
}
while(k != last){
k++;
textureFileName[k-i-1] += args[k];
}
}
}
}
}else{
System.err.println(usageMessage);
System.exit(-1);
}
if(objName.equals("") || textureFileName.length==0){
System.err.println(usageMessage);
System.exit(-1);
}
TextureManager tm = TextureManager.getInstance();
for(int i=0; i<textureFileName.length;i++){
tm.addTexture(textureFileName[i],new
Texture(inputPath+textureFileName[i]));
}
try{
File objfile = new File(inputPath+""+objName+".3DS");
Object3D[] obj = Loader.load3DS(new FileInputStream(objfile),
1);
inputObject3D = Object3D.mergeAll(obj);
}catch(FileNotFoundException fnfEX){
System.err.println(""+fnfEX);
System.exit(-1);
};
inputObject3D.build();
DeSerializer deSer = new DeSerializer();
try {
fileSer = new File(inputPath+""+objName+".ser");
FileOutputStream outStreamSer = new FileOutputStream(fileSer);
deSer.serialize(inputObject3D, outStreamSer, true);
} catch (FileNotFoundException e) {
System.err.println(""+e);
System.exit(-1);
}
System.out.println("Finished!");
}