Main Menu
Menu

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.

Show posts Menu

Messages - nico_r_a

#1
Support / Re: How can I serialize a mesh?
August 11, 2011, 03:46:24 PM
so with the touchevents i can slide
#2
Support / Re: How can I serialize a mesh?
August 11, 2011, 03:18:45 PM
i have found your code in the topic "How to rotate and move 3D object in world space by 2D mouse coordinaes?"
but how do i add this library in android?
import java.awt.Color;
import java.awt.Graphics;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
#3
Support / Re: How can I serialize a mesh?
August 11, 2011, 11:05:44 AM
and is there a topic who is good to explain how we change between the camera when we click on a part (precise) of the screen?
#4
Support / Re: How can I serialize a mesh?
August 11, 2011, 09:22:20 AM
but when i looks the console while the compilation of jpct (to create a file ser)
i see that
ai1_jPCT0
ai2_jPCT1
do you use this name may be?
#5
Support / Re: How can I serialize a mesh?
August 11, 2011, 02:29:57 AM
but if i write this in my application

TextureManager.getInstance().flush();
TextureManager tm = TextureManager.getInstance();

Texture textureai1 = new Texture(getResources().getDrawable(R.drawable.ai1));
Texture textureai2 = new Texture(getResources().getDrawable(R.drawable.ai2));

tm.addTexture("ai1", textureai1);
tm.addTexture("ai2", textureai2);

i have loaded nothing texture in my scene, nothing
#6
Support / Re: How can I serialize a mesh?
August 10, 2011, 04:53:51 PM
actually, i am going to give you an example to explain my problem
i have three textures :
1.jpg
2.jpg
3.jpg

And i have 3 objects in my scene 3ds when i load on the emulator
on the first object i see 1.jpg
on the second object i see 1.jpg
on the third object i see 1.jpg

whereas i should have when i load
on the first object i should see 1.jpg
on the second object i should see 2.jpg
on the third object i should see 3.jpg
#7
Support / Re: How can I serialize a mesh?
August 10, 2011, 02:53:01 PM
ok, but do you have an idea for my code because i always have nothing with my texture??
and if i load the texture in my 3ds, do i keep the texture after when i load in my application android without used (the texture manager)?
#8
Support / Re: How can I serialize a mesh?
August 10, 2011, 01:42:10 PM
shadow effect, (sorry i have done a mistake of traduction)
do you have an idea about the texture when you see my code??
because my code correspond at your explications
#9
Support / Re: How can I serialize a mesh?
August 10, 2011, 01:09:52 PM
actually, on the emulator i have only one texture which is load on all objects. whereas i should have 32 textures loaded on each object with each object a texture different.
and is there shape effect with the jpct if i put a spotlight in my 3ds or in the code android ?
so the second code is not good? i should rather use a texture 512*512
#10
Support / Re: How can I serialize a mesh?
August 10, 2011, 11:58:30 AM
i don't arrive to load the texture, actually i think to load in my code several texture but the application load only one texture on the all object of the scene.
in my jpct to create the ser i write nothing on the texture, don't you?*
in my application android, (my textures are 256*256 or 512*512) it's not a problem?


TextureManager.getInstance().flush();
TextureManager tm = TextureManager.getInstance();

Texture textureai1 = new Texture(getResources().getDrawable(R.drawable.ai1));
Texture textureai2 = new Texture(getResources().getDrawable(R.drawable.ai2));

tm.addTexture("ai1", textureai1);
tm.addTexture("ai2", textureai2);

    Object3D[] scee = Loader.loadSerializedObjectArray(getResources().openRawResource(R.raw.sersce));

world.addObjects(scee);

for(int i = 0; i < scee.length; i++) {
            System.out.println("serializing object: " + i + "/" + scee.length);

SimpleVector Sv = new SimpleVector();
Sv.x = 0;
Sv.y = 0;
Sv.z = 0;
scee[i].strip();
scee[i].build();





so i have tried this second code too, because i have said me that the size of texture is too much, but it's more long and sometimes there is a bug (i have to load 32 textures)


TextureManager.getInstance().flush();
TextureManager tm = TextureManager.getInstance();

     Texture textureai1 = new Texture(BitmapHelper.rescale(BitmapHelper.convert(getResources().getDrawable(R.drawable.ai1)), 256, 256));
     Texture textureai2 = new Texture(BitmapHelper.rescale(BitmapHelper.convert(getResources().getDrawable(R.drawable.ai2)), 256, 256));
     
textureai1.compress();
textureai2.compress();

tm.addTexture("ai1", textureai1);
tm.addTexture("ai2", textureai2);

    Object3D[] scee = Loader.loadSerializedObjectArray(getResources().openRawResource(R.raw.sersce));

world.addObjects(scee);

for(int i = 0; i < scee.length; i++) {
            System.out.println("serializing object: " + i + "/" + scee.length);

SimpleVector Sv = new SimpleVector();
Sv.x = 0;
Sv.y = 0;
Sv.z = 0;
scee[i].strip();
scee[i].build();




Do you have a solution??
and another question, if i put color on object in my 3ds ,and i put a spotlight (near camera) in my 3ds or with the application android, will i have the shape effect on the object??
#11
Support / Re: How can I serialize a mesh?
August 10, 2011, 10:46:52 AM
thank you very much  ;D ;D ;D ;D ;D ;D ;D ;D
i have loaded the 3ds thantks to file ser. but i have loaded without texture
now the scene load in 1minute, it's great
i am going to try to load with texture now, thank you
#12
Support / Re: How can I serialize a mesh?
August 09, 2011, 03:08:37 PM
I have changed my code, but now i have "n" file ser (about 30ko each) with "n" the number of object in my 3ds.
It' better than before, but the problem is to load each ser.
i have tried to use the array but there is an error then i use it,
the code in my jpct to create ser is this


        for(int i = 0; i < scee.length; i++) {
             System.out.println("serializing object: " + i + "/" + scee.length);
            scee[i].build();
            de.serialize(scee[i], new FileOutputStream("C:/workspace/file/res/raw/serscee"+i+".ser"), true);
        }

How do i do to not load  each ser one per one, i try , i try to load by array but i don't arrive, there is possibility that you help me same if i am bad in java
because i would like to introduce the "de.serializearray" but it's incompatible with the "scee[ i ]"


and i always have the problem with the texture because like my scee is in "object3D[]", this line of code is specified with error in eclipse, so i have written this

tm.addTexture("ai", textureai);
        scee[i].setTexture("ai");

but now in the console after the compilation, there are written to each texture

[ Tue Aug 09 ] - ERROR: A texture with the name 'ai' has been declared twice!



#13
Support / Re: How can I serialize a mesh?
August 09, 2011, 09:39:32 AM
so in my jpct (to create the ser)
i have writen this


Object3D[] sce = null;

TextureManager.getInstance().flush();
TextureManager tm = TextureManager.getInstance();

Texture textureai = new Texture("C:/workspace/file/res/drawable/ai.jpg");


DeSerializer de;
       
       
        sce = Loader.load3DS("C:/workspace/file/res/raw/sce.3ds",20);

        tm.addTexture("ai", textureai);
        sce.setTexture("ai");

  //  sce.build();


de = new DeSerializer();
       
       
        de.serializeArray(sce, new FileOutputStream("C:/workspace/file/res/raw/sersc.ser"), true);




When i have changed the "serialize" by the "serializeArray", eclipse has asked to change "object3d" by "object3d[]" and since i have lots of mistakes
but i have an error on the line         
sce.setTexture("ai");
sce.build()


and i writte this in my application android


Scee = Loader.loadSerializedObjectArray(getResources().openRawResource(R.raw.sersc));

and i have the same problem that in my jpct i have changed the
Scee = Loader.loadSerializedObject(getResources().openRawResource(R.raw.sersc));
by
Scee = Loader.loadSerializedObjectArray(getResources().openRawResource(R.raw.sersc));

So eclipse says me that i must to change the objkect 3d in object3[] what create lots of mistakes
example : world.addObject(Scee);


#14
Support / Re: How can I serialize a mesh?
August 08, 2011, 11:21:47 PM
thank you for the reply by the mail. I listen your advice. But you have said i load the object in the array and i work with but i don't see.
Because in my file .3ds i have 80  objects how do i to load all this object in minimum of line code?
because i don't ssee how do i load the 3ds with all this object same after i have read your doc on the deserialize.
#15
Support / Re: How can I serialize a mesh?
August 08, 2011, 02:37:04 PM

    public static void main(String[ ] args)  throws FileNotFoundException {
        Object3D[] sc = null;


        DeSerializer de;
        sc = Loader.load3DS("C:/workspace/file/res/raw/sc.3ds",20);

        //sc.build;
        de = new DeSerializer();
        de.serializeArray(sc, new FileOutputStream("C:/workspace/file/res/raw/sersc.ser"), true);
    }
}

i write this, i have modified the serialize by the serializeArray, but i have still an object which is loaded
i am sorry, but i read and i read your doc deserialize, but i have big problem to understand (in english it's not easy to me so i ask you lots of questions)

so how do i serialize a file (lots of object) please? ? ?


in more when i try to compil my program  java with texture to create a file ser
the console says me :
"[ Mon Aug 08 17:23:19 CEST 2011 ] - ERROR: Tried to set an undefined texture as default!"
while i have given the good name associated between the object and the texture

    TextureManager.getInstance().flush();
TextureManager tm = TextureManager.getInstance();
   Texture textureai= new Texture("C:/workspace/file/res/drawable/ai.jpg");
        tm.addTexture("ai", textureai);
        scene.setTexture("textureai");


it's correct, is'nt it??
and how do i serialize a file (lots of object) please? ? ? ?