Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - dubbox

Pages: 1 [2]
16
Support / Apply Texture Unsupported Texture width (Not using Drawable)
« on: September 30, 2014, 11:45:22 pm »
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

Code: [Select]
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

Code: [Select]
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!");
}

17
Support / Blender Scene Exporter fails
« on: September 24, 2014, 03:00:34 pm »
Hi Guys
I have found the Blender Scene Exporter and used it and tried the SampleScene it worked just fine
But when i try to export my own Scene it gives an error and there are no files in the /texture folder and no xml file like there was in the sampleScene

the error is in the descreption need your help

the exported scene is a .blend file and is in a single folder in which is also a /Texture folder with the texture

it is only 1 .jpg texture 450 KB so i dont get why it should give erros cause nothing is diffrent to the sample scene i am just using point ligths

the error should be at the textures cause it seems like there is a problem to generate the list or so

the script is the script made by andresjesse

can be found at https://github.com/andresjesse/jpctblend/tree/master/blender%20python%20exporter

i think the tex is not put into the list but i dont get why maybe it is not getting a name but in blender it is added to an material and named in floorMat (Material) and floor (Texture) it is applied by an uv map so i think i have done everything like it should be

ps the last line says : location: <unkown location>:-1

18
Support / Re: very low Quality need help
« on: September 20, 2014, 05:19:12 pm »
another question :D

the old question still needs an answer but i want to ask you guys something else
i know that you can paint with blit things like strings textures but how can i integrate real buttons in my app like in a gui do i just make an image like a button and wait for the image to be clicked or is there another option?

19
Support / very low Quality need help
« on: September 20, 2014, 02:38:41 pm »
Hey guys i am loading a serialized object and the quality is very very low
it a model of a building which im using to move inside but you cannot recognize anything i dont know if its a problem in lighting or in rendering you cant even see a difference between the sidewalls and the floor cause its both grey
im jusing a sun and an ambient ligth and GLSurfaceView.Renderer

please help i dont know what i am missing here to make it look realistic the model is created in blender and there it looks awesome even not rendered just in the object view

20
Support / Re: NullPointerException loading .zip File need Help
« on: September 19, 2014, 02:45:29 pm »
that is what i did still no change :(

21
Support / Re: NullPointerException loading .zip File need Help
« on: September 19, 2014, 02:12:07 pm »
Data exceeds UNCOMPRESS_DATA_MAX (3584357 vs 1048576)
seems like that is the problem rigth here? can i do sth about that or do i have to reduce the memoryspace my model needs?

22
Support / Re: NullPointerException loading .zip File need Help
« on: September 19, 2014, 11:15:20 am »
C:\Users\Jascha\workspace\TestAndroid\res\raw\ab.zip thats the correct file path testandroid is my project and in ab.zip is ab.ser

23
Support / Re: NullPointerException loading .zip File need Help
« on: September 19, 2014, 11:10:33 am »
I get excactly the same error Egon ;(
I dont know its the same error in the line where the loader loads the obj out of the zipinputstream

i changed the code like this

ZipInputStream zis = new ZipInputStream(mContext.getResources().openRawResource(R.raw.ab));
            try {
               zis.getNextEntry();                                                               
            } catch (IOException e) {e.printStackTrace();}
            model = Loader.loadSerializedObject(zis);

what am i missing here it still says null pointer exception and after that that you cant deserialize object null

24
Support / NullPointerException loading .zip File need Help
« on: September 18, 2014, 09:13:20 pm »
Hi Guys,
I am currently working on a Project but my problem is i got a big file cause it is a building for a game to move in. I serialized it and now zipped it also cause i had a outofmemory exception but the loading from the zip file doesnt work here is the code

ZipInputStream zis = new ZipInputStream(mContext.getResources().openRawResource(R.raw.ab));
//            try {
//            if(zis.getNextEntry() != null)
//               zis.getNextEntry();                                                               tried this already
//            } catch (IOException e) {e.printStackTrace();}
            model = Loader.loadSerializedObject(zis);
            
//         model.calcTextureWrapSpherical();
//            model.setTexture("texture");
            model.strip();

            model.scale(10);
            model.build();
            
            world.addObject(model);


the exception i get is: (im not getting whats actually wrong here so i ask you guys)

Systemerr:
java.lang.NullPointerException at com.threed.jpct.DeSerializer.deserialize(DeSerializer.java:61)
                                       at com.threed.jpct.Loader.loadSerializedObject(Loader.java:104)
                         at and.testandroid.JPCTAESkeletonActivity$MyRenderer.onSurfaceChanged(JPCTAESkeletonActivity.java:197)
                                           at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1325)
                                      at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1116)

so i get this fatal error
java.lang.RuntimeException: [ 1411066378308 ] - ERROR: Can't deserialize object: null

i know that the loader seems not to load the file correctly but why?
file is located in res/raw/ab.zip/ab.ser
so what am i missing here that it cannot be loaded?

i serlialized the object with that code
Object3D model = null;
        String modelName = "ab";
     //   TextureManager.getInstance().flush();


       //TextureManager tm = TextureManager.getInstance();
       //Texture grass2 = new Texture("C:/Worksapce/SaveMe/res/raw/f15e.jpg");
        DeSerializer de = new DeSerializer();
        model = model.mergeAll(Loader.load3DS(new FileInputStream("C:/Users/Jascha/documents/3DObjects/"+modelName+".3ds"), 1));
        model.build();
        de.serialize(model, new FileOutputStream("C:/users/Jascha/documents/3DObjects/serialized/"+modelName+".ser"), true);

code worked fine with small models and without zip

Thank you for your help

Pages: 1 [2]