I am trying to create a simple two-models system, where I can control each model by moving the targets around.
What I learned through the forums is that I should use an image target as the world center.
So what I tried, as this link suggests, is create an offset-matrix using pose matrixs of the two targets, and then applying it to the center of the second target (0,0,0,1), to get the new coordinates of the center relatively to the first target.
Then I use the new location of the center in model.setLocalTranslation() method to get the second model in the center of the second image target at each frame update.
When I move the paper in a translation mouvement, I get exactally what I wanted.
The problem is when I rotate the paper, thus changing one or both image target rotation : the second model does not get painted over the center of the second target.
I've come to conclude that the problem is either on the way I am calculation the new image target center, or the way I am updating the second model position, or maybe in the whole approch..
Any help would be very appreciated