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

Pages: [1]
1
Support / Problem with object picking and modified camera backbuffer matrix
« on: December 15, 2011, 03:40:51 pm »
Hi,

I'm currently developing an AR-App and use jPCT-ae for rendering. To affix the model on a marker I receive a pose matrix and apply her to the camera with camera.setBack(). This works for putting my model on the marker, but I can't get picking to work with it. If I just render my model without changing the camera matrix it works fine, but as soon as I change her, it doesn't work anymore (calcMinDistanceAndObject3D() returns everywhere on my object COLLISION_NONE). Since the picking needs the camera position, I assume that something with the position vector is wrong.

My picking code:
Code: [Select]

private void doPicking(int touchX, int touchY){
SimpleVector dir = Interact2D.reproject2D3DWS(camera, frameBuffer, touchX, touchY).normalize();
Object[] res = world.calcMinDistanceAndObject3D(camera.getPosition(), dir, 10000);
  if (res[1] != null) {
    //do something...
 
  }
}


Object properties:

Code: [Select]
Object3D[] serializedObject = Loader.loadSerializedObjectArray(serializedInputStream);

for (int i = 0; i < serializedObject.length; i++) {
serializedObject[i].setCollisionMode(Object3D.COLLISION_CHECK_OTHERS);
if (i > 0) serializedObject[i].addParent(serializedObject[0]);
serializedObject[i].strip();

}


Camera pose setting:

Code: [Select]

public void onDrawFrame(GL10 arg0) {

//...

float[] matrix = getMatrixForJPCT(new float[16]);

Matrix mat = new Matrix();
mat.setDump(matrix);

//If I comment this out, picking works flawless:
camera.setBack(mat);

//...
}


Any idea why that is?

2
Support / Getting the pose of the camera?
« on: November 15, 2011, 10:16:07 am »
Hello,

is it possible to get the pose of the camera? I tried getting the backbuffer matrix with getBack(), but that doesn't seem to be the same. If I apply e.g. a translation on the camera, the backbuffer matrix will remain the same as before the transformation.

3
Support / Getting Sub-Objects from *.obj file?
« on: October 12, 2011, 12:03:47 pm »
Hi.

I'm loading a Wavefront obj file, that consists of serveral sub-objects (I noticed that jpct processes each of these objects when compiling). Using the picking tutorial from the wiki, I can now successfully choose between the objects I have in my scene with the touchscreen. It would now be interesting to somehow access (like adding transparency, or removing them temporarily) these sub-objects. I found that I can create a PolygonManager from the object, but it doesn't seem to help me, because I can only manipulate the polygons (duh). Is there any way to get access to the sub-objects in jpct?

Pages: [1]