Thank you again for your help, however I can't get the native example to compile. I suppose my setup is insufficient, I suspect that I failed with Cygwin.
However as I can understand from the documentation, I do not need the native sample to do what I want (change amplitude of sound based on distance to target).
Therefore I have tried to work with the ImageTargets part of the "VuforiaSamples" project.
However I suspect the sample code provided is in C++ and I'm not able to "convert" it to java, in order to use it in the VuforiaSamples project.
I'm working in ImageTargetRenderer.java >> renderFrame()
I've found the following which seems like what I need to focus on: (app. line 190 in the original sample).
// did we find any trackables this frame?
for (int tIdx = 0; tIdx < state.getNumTrackableResults(); tIdx++)
TrackableResult result = state.getTrackableResult(tIdx);
Trackable trackable = result.getTrackable();
Matrix44F modelViewMatrix_Vuforia = Tool
float modelViewMatrix = modelViewMatrix_Vuforia.getData();
The sample code tells me to include "math.h", in java I've imported "java.lang.Object" which should contain "sqrt()" (which I suspect is the reason for including math.h?).
In order to calculate the distance I've added the following code right below what is shown above here. But I have som problems I can't resolve and I hope I can get some help to get this working. (I've added "Aske" to my own variable to ensure it doesn't conflict with unknown existing variables).
float poseAske = modelViewMatrix;
Vector3 positionAske = new Vector3((poseAske.data, poseAske.data, poseAske.data);
float distance = sqrt( positionAske.data * positionAske.data +
positionAske.data * positionAske.data +
positionAske.data * positionAske.data);
String tempDistance = Float.toString(distance);
As I see it, my major problem is to get some working equivalent of "Matrix34F" and "Vec3F". It is not something recognised in the java sample and not something I know hot get imported.