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

#1
Thanks for the answer, i already did that. Did not merge, added all to world. But when i need to rotate the whole object i fail. Cos every object's pivot point is their calculated center. Also i tried to create a dummy Object3D and add the objects from 3ds to it, i could not get it shown on screen. As long as i am using one model in the world in my app, i am able to use camera for rotation. But when i began to add multiple models into the world camera rotation will not be a solution.

Aim of this app is to make user place furnitures around and change textures on any of them to fit in his/her room.

Is it possible to add all of the objects to one Object3d created on the fly as children?

Thanks
#2
Here is a sample screenshot. How to change texture of pillows only?


Loading code is below...

   private Object3D load3dsModel(String filename, float scale) throws IOException {
      InputStream stream = MainActivity.this.getApplicationContext().getAssets().open(filename);
      Object3D[] model = Loader.load3DS(stream, scale);
        Object3D o3d = new Object3D(0);
        Object3D temp = null;
        for (int i = 0; i < model.length; i++) {
            temp = model;
            temp.setCenter(SimpleVector.ORIGIN);
            temp.rotateX((float)( -.5*Math.PI));
            temp.rotateMesh();
            temp.setRotationMatrix(new Matrix());
            o3d = Object3D.mergeObjects(o3d, temp);
            o3d.build();
        }
        return o3d;
    }

in other routine...

curModel = loadObjModel("kanepe.3ds", 0.05F);
world.addObject(curModel );
#3
Hello,

i am loading 3ds model into the world and it is all loaded with textures. But after than i need to change some textures of sub objects (for example, pillow textures inside a sofa model) i cannot access sub objects of the whole model. (Also when loading 3ds model we merge all objects into one as seen on the sample code on jptc site, is it about that?)

How can we do this in jptc?