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

#1
Support / Re: Line of sight
August 03, 2016, 05:56:16 PM
Thank you
#2
Support / Line of sight
July 28, 2016, 01:09:07 PM
I studied the jpct-ae docs, but I just couldn't find a way to set whether an object has to be set visibile or not depending on the camera position. To clarify, If I am near an object I see it, if I am really far away, instead of seeing it small, I don't want it to be visible at all.

So I started developing my own mechanism to make it possible.

Is it so?
#3
Support / Re: JPCT-AE Serialization issue
July 25, 2016, 05:54:13 PM
if it could help someone, I solved the issue not serializing the texture anymore but simply transferring the bitmap like this:

ByteArrayOutputStream stream = new ByteArrayOutputStream();
            BitmapFactory.decodeResource(act.getResources(), textureID).compress(Bitmap.CompressFormat.JPEG, 100, stream);
           
JSONObject jsonObject = new JSONObject();
jsonObject.put("file", org.apache.commons.codec.binary.
                StringUtils.newStringUtf8(org.apache.commons.codec.binary.Base64.encodeBase64(stream.toByteArray())));
           
#4
Support / Re: JPCT-AE Serialization issue
July 25, 2016, 01:43:34 PM
that's actually what I already do. That's the method I call inside the onDrawFrame method:

private void addObject3DToWorld(Object3D object3D,float x, float y, float z){
        //Log.e("object:"+object3D.getName(), "CREATED at:"+x+" y:"+y+" z:"+z);


        object3D.setTexture(object3D.getName());
        object3D.translate(x, y, z);
     

        world.addObject(object3D);
        objectPositions.put(object3D.getID(),object3D.getCenter());
     
    }


#5
Support / Re: JPCT-AE Serialization issue
July 22, 2016, 04:35:31 PM
I am actually experiencing a new issue.

My attempt is to transfer the object3d in a JSon enconding by serializing the object3d and the texture which I learned from the docs to be Serializable as well.

The result is that the model is rendered, but it is not textured. This is basically what I'm doing in a separate thread that than adds the object to a thread safe queue that the ondraw method polls to look for new objects:

public  void run(){

            JSONObject job = new JSONObject(message);

            Boolean successful = (Boolean) job.get("successful");
            if(successful){
                String basename = job.getString("basename");
                byte[] txtr =(org.apache.commons.codec.binary.Base64.decodeBase64(job.getString("file").getBytes()));
                Texture texture = Object3DManager.deserializeTexture(txtr);

                Log.e(TAG, "textured!");
                if(texture==null)
                    Log.e(TAG,"texture==null");

                TextureManager.getInstance().addTexture(basename, texture);

                    byte[] obj3Ddata =  (org.apache.commons.codec.binary.Base64.decodeBase64(job.getString("obj3d").getBytes()));
                    Log.e(TAG,"obj3Ddata len:"+obj3Ddata.length);
                    Object3D o3d = Object3DManager.deserializeObject3D(/*blob.array()*/obj3Ddata);

                    jpctWorldManager.addObjectToCreationQueue(o3d,loc);

            }
            else {
                Log.e(TAG, job.getString("message"));
                return;
            }

    }

Is it better to call build() on the sender or the receiver side?
Also the untextured model moves in a bursty way, as I rotate the camera.

Any help would be great.

Thanks
#6
Support / Re: JPCT-AE Serialization issue
July 15, 2016, 03:01:13 PM
ok, I'm waiting to hear from you  ;)

thanks
#7
Support / Re: JPCT-AE Serialization issue
July 15, 2016, 02:29:38 PM
Yes, I think it would be the only solution left. I just thought about handling the serialization from the client side thus improving the loading performance to the server side without adding the complexity of a separate java tool using JPCT to serialize the objects. 


I'm actually writing an Android framework for Augmented Reality that I'm willing to share with JPCT-AE users however.
#8
Support / JPCT-AE Serialization issue
July 15, 2016, 12:59:21 PM
Hello everybody,

I need to transfer object3D through a websocket from an android device to another. I was evaluating some options. One of them would be to serialize the Object3D and send it, but as far as I understood, the only way to serialize an object3D would be to do it through JPCT for Java.

Is it possible to install JPCT (not JPCT-AE) on the android device just to use the DeSerializer class on object3Ds instanciated with JPCT-AE?

Thanks for your help
#9
Support / Angle of vision in landscape mode
July 08, 2016, 03:39:09 PM
Hello everybody,

I'm working on a framework for augmented reality using the JPCT library to do the rendering stuff and positioning objects in the space starting from their geographical coordinates.

I'm trying to set an angle of view to limit the presence of object on the screen to the ones that are directly visible along that direction. Actually some objects appear to the side of the screen when they are near, I would like to limit the focus of the camera.

I think my issue would be related to the FOV angle concept, but just changing its value I wasn't able to reaching my goal.

Could anyone give me some clarification about it? My app works on landscape mode.