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

#16
Support / JPCT-AE+Vuforia: primitive plane not showing
November 24, 2014, 08:54:44 AM
Hai, i try to render primitive plane , but it is not showing. But if i render primitive box or cylinder it  just fine. 

plane = Primitives.getPlane(20, 30);
plane.setTexture("texture");
plane.strip();
plane.build();
world.addObject(plane);
cam = world.getCamera();
SimpleVector sv = new SimpleVector();
sv.set(plane.getTransformedCenter());
sv.y += 100;
sv.z += 100;

sun.setPosition(sv);

MemoryHelper.compact();


Thank you
#17
Support / Re: set texture at runtime
November 24, 2014, 02:10:23 AM
Thank you Wolf17 for the answer  ;)
#18
Support / set texture at runtime
November 20, 2014, 08:53:46 AM
hai, i want to change texture in plane when i click button. how to do it? thank you
#19
hai, sorry for late reply.. i run the program in smartphone LG L90..i dunno if it's Intel based or not..
#20
hello,
i got error Fatal signal 11, i run the program in android device not in emulator. And i already adding tag android:allowClearUserData="true"
any suggestion?
Thx
#21
Support / Re: How to caculate the 3d model size ?
October 23, 2014, 05:23:02 AM
Thank you egon, it's work now  :)
#22
Support / Re: How to caculate the 3d model size ?
October 22, 2014, 10:35:02 AM
hai ,  i have 3d model that if i select image in gridview the model show up, but 3D model come with diffrent size..some show too  much bigger,some show too little.

  cube=Primitives.getBox(15,3);
      cube.calcBoundingBox();
      float[] bb=cube.getMesh().getBoundingBox();
      float xDiff=bb[1]-bb[0];
      float yDiff=bb[3]-bb[2];
      float zDiff=bb[5]-bb[4];
      float scale_cube=cube.getScale();
    obj=Loader.load3DS(new FileInputStream(f),30f)[0];
    getSize(obj).x=xDiff;
    getSize(obj).y=yDiff;
    getSize(obj).z=zDiff;
    obj.setScale(scale_cube);
    obj.strip();
obj.build();
}

  public static SimpleVector getSize(Object3D object){
float[] bbox = object.getMesh().getBoundingBox();
float s = object.getScale();
Log.i("Util","getSize-scale:"+object.getScale());
Object3D[] par;
par = object.getParents();
while(par.length>0){
s = s*par[0].getScale();
Log.i("Util","getSize-parent:"+par[0].getScale());
par = par[0].getParents();
}
SimpleVector out = new SimpleVector((bbox[1]-bbox[0])*s,(bbox[3]-bbox[2])*s,(bbox[5]-bbox[4])*s);
Log.i("Util", "getSize:"+out.toString());
return out;
}

But my code not working..can you help me..thanks
#23
hi, Egon. Try to understand and so far this is my code:

      cube=Primitives.getBox(15,3);
      cube.calcBoundingBox();
      float[] bb=cube.getMesh().getBoundingBox();
      float xDiff=bb[1]-bb[0];
      float yDiff=bb[3]-bb[2];
      float zDiff=bb[5]-bb[4];
      float s=cube.getScale();
  SimpleVector out = new SimpleVector(xDiff*s,yDiff*s,zDiff*s);

am i in the right path?
#24
Support / Re: Question on Multitexturing
October 20, 2014, 10:44:36 AM
Hi egon, i have something to ask again.. if i want get proper texture name not from output log, how do that?
Thx you again 
#25
Support / Re: Question on Multitexturing
October 20, 2014, 09:47:45 AM
Thank you egon.it's work now :)

#26
Support / Re: Question on Multitexturing
October 20, 2014, 06:47:50 AM
hi egon, i don't understand about texture names in TextureManager. I have model with 3 texture file :Bear_Eyes+eeth+Nail_Diffuse.jpg, Bear_Specular.jpg, and Bear_Diffuse.jpg

teeth = new File(Environment.getExternalStorageDirectory(),"Folder/"+subfolder+"/"+"Bear_Eyes+eeth+Nail_Diffuse+".jpg");
body= new File(Environment.getExternalStorageDirectory(),"Folder/"+subfolder+"/"+"Bear_Diffuse".jpg");

TextureManager txtMgr = TextureManager.getInstance();
Texture texture1 = new Texture(new FileInputStream(teeth));
Texture texture2 = new Texture(new FileInputStream(body));
txtMgr.addTexture("texture1", texture1);
txtMgr.addTexture("texture2", texture2);
object.setTexture("texture1");
object.setTexture("texture2");


but texture of teeth and body not apply :( ..am i wrong using texture names and TextureManage?Please guide me. thanks egon
#27
I trying to add getBoundingBox.. here is my code:
try {
     
      // Create a texture out of the icon...:-)
      TextureManager txtMgr = TextureManager.getInstance();
         if (!txtMgr.containsTexture("texture")) {
            Texture texture = new Texture(new FileInputStream(t));
            txtMgr.addTexture("texture", texture);
           }
         else{
           Texture old_texture = new Texture(new FileInputStream(t));
           txtMgr.replaceTexture("texture", old_texture);
            }
    
       cube=Loader.load3DS(new FileInputStream(f),scale)[0];
       cube.calcBoundingBox();
       float[] bb=cube.getMesh().getBoundingBox();
       scale=bb[mViewHeight];
       cube.setTexture("texture");
       cube.strip();
        cube.setTexture("texture");
      cube.build();
        } catch (IOException e) {
         e.printStackTrace();      
   }
please more guide..thank you
#28
Thank Egon, will try getBoundingBox
#29
In my app, am using JPCT-ae for 3d rendering. I am downloading 3d models form server and rendering it in android device. my problem is some models are small and some are very big. I want to set one generic scale for all the models regardless of what scale they were exported with. so that when i render them on device they should be of same size.

I dont know to do it. please any idea any help is very much appreciated.