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.


Topics - dubbox

Pages: [1]
1
Support / How to get Object3D's Position when loaded from .3ds
« on: January 01, 2015, 05:53:19 pm »
I am confused all the get Methods which return a SimpleVector for the Object3D are not the ones i am looking for nearly all are 0,0,0,0

I just want to get the Position or Translation (the getTranslation Method does not work for me its 0,0,0,0) of an Object created in Blender and saved as .3ds file

In Blender for example a created cube is at 4,5,1 so how can i get this position after loading it into jpct-ae?

The getName() Method works nicely so i just want to get the Name and the position so i get something like :
"Cube001 at (4,5,1)"

2
Support / Blitting shows in Emulator but not on Smartphone HELP
« on: October 07, 2014, 06:22:57 pm »
Hello since im new to Texturing i am gonna need to ask you another question and hope you can help again

i am quiet confused because i worked out how to blit tetures to use them as gui elements and so i implemented 2 buttons with 4 textures 2 per each (one pressed one normal)

everything works fine the emulator shows all the buttons and the clicking effects working nicely

but now i loaded the .apk to my smartphone and i cant see any of the buttons i added i thought blitting is for android
i checked twice if i had exported the rigth way etc i dont know what i am doing false everything runs on smartphone without errors but no buttons are visible


here i add the textures to the texturemanager in the onsurfacecreated method
Code: [Select]
bhn = new Texture(getAssets().open("Buttons/bhn.png"));
bhp = new Texture(getAssets().open("Buttons/bhp.png"));

bfn = new Texture(getAssets().open("Buttons/bfn.png"));
bfp = new Texture(getAssets().open("Buttons/bfp.png"));
} catch (IOException e) {
e.printStackTrace();
}
if(!tm.containsTexture("bhn"))
tm.addTexture("bhn", bhn);
if(!tm.containsTexture("bhp"))
tm.addTexture("bhp", bhp);

if(!tm.containsTexture("bfn"))
tm.addTexture("bfn", bfn);
if(!tm.containsTexture("bfp"))
tm.addTexture("bfp", bfp);
}

and here i blit them in the ondrawframe method

Code: [Select]
fb.clear(back);
world.renderScene(fb);
world.draw(fb);

//Blitting
fb.blit(tm.getTexture(bh), 0, 0, bhnX, bhnY
,128 ,128 , buttonWidth, buttonHeight, 100, false, null);
fb.blit(tm.getTexture(bf), 0, 0, bfnX, bfnY
,128 ,128 , buttonWidth, buttonHeight, 100, false, null);
fb.display();

i am kind of helpless rigth here because i am new to jpct ae and all that stuff and there is no error output i could watch
i hope you guys can think of a cause for my problem or maybe you had the same so please share your opinions with me

thank you all for your help

3
Support / Question on Multitexturing
« on: October 05, 2014, 05:12:51 pm »

SOLVED

Hello it is me again :D

Thanks to the help of Egon i applied textures to my .3ds object and load it successfully into android

now i got another question i have read all the posts about multitexturing but i still have a question about it

In some posts its said that .3ds doest not support multi texturing but there is also said that you can apply multiple textures by using the TExtureManager with the rigth names

so what do i have to do?

Do i have to load my model splitted up by texture like one .3ds file for the roof with the roof texture
 another .3ds for the wall with the wall texture

and then merge them together

or

do i have to apply all the textures on one .3ds model and use the texture names for the texture manager??

i tried it using the texturemanager but i am not getting it to work the textures are not showed at all

so what is the best way and maybe some explination code would help
thank you

this is my code right now

Code: [Select]
try {
Texture teppich=new Texture(assetManager.open("teppichHems.jpg"));
Texture decke=new Texture(assetManager.open("StyroporDecke.jpg"));
Texture wand=new Texture(assetManager.open("WandBlech.jpg"));

TextureManager.getInstance().addTexture("Texture.001", teppich);
TextureManager.getInstance().addTexture("Texture", decke);
TextureManager.getInstance().addTexture("Texture.002", wand);
} catch (IOException e) {
e.printStackTrace();
}


    try {
model = Loader.load3DS( assetManager.open("thirdfloorAndroid.3ds"), 1);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

4
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!");
}

5
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

6
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

7
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]