i have done video , and image , but have issue on 3d integration with vuforia
your example about integration is working fine , but it was related to native Example of vuforia ,
i have done the same with java videoPlayBack Vuforia example , but have error in update 3d view regard to camera calibration
Here is my code for load 3d : at videoPlayBackrender.java constructor
this.mActivity = activity;
world = new World();
world.setAmbientLight(20, 20, 20);
sun = new Light(world);
sun.setIntensity(250, 250, 250);
// Create a texture out of the icon...:-)
com.threed.jpct.Texture texture = new com.threed.jpct.Texture(
BitmapHelper.rescale(BitmapHelper.convert(mActivity
.getResources().getDrawable(R.drawable.ic_launcher)),
64, 64));
TextureManager.getInstance().addTexture("texture", texture);
try {
cube = Object3D.mergeAll(Loader.load3DS(
mActivity.getAssets().open("skeleton.3DS"), 10.0f));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// cube = Primitives.getCube(10);
// cube.calcTextureWrapSpherical();
cube.strip();
cube.build();
world.addObject(cube);
cam = world.getCamera();
// cam.moveCamera(Camera.CAMERA_MOVEOUT, 50);
// cam.lookAt(cube.getTransformedCenter());
SimpleVector sv = new SimpleVector();
sv.set(cube.getTransformedCenter());
sv.y -= 100;
sv.z -= 100;
sun.setPosition(sv);
MemoryHelper.compact();
Here on RenderFrame() method i get modelViewMatrixKeyframe
for (int tIdx = 0; tIdx < state.getNumTrackableResults(); tIdx++) {
// Get the trackable:
TrackableResult trackableResult = state.getTrackableResult(tIdx);
ImageTarget imageTarget = (ImageTarget) trackableResult
.getTrackable();
Log.d("archer", imageTarget.getName());
int currentTarget = 0;
// We store the modelview matrix to be used later by the tap
modelViewMatrix[currentTarget] = Tool
.convertPose2GLMatrix(trackableResult.getPose());
float[] modelViewMatrixKeyframe = Tool.convertPose2GLMatrix(
trackableResult.getPose()).getData();
and then update 3d
float x = modelViewMatrixKeyframe[12];
float y = modelViewMatrixKeyframe[13];
float z = modelViewMatrixKeyframe[14];
modelViewMatrixKeyframe[12] = 0;
modelViewMatrixKeyframe[13] = 0;
modelViewMatrixKeyframe[14] = 0;
CameraCalibration calibration = CameraDevice.getInstance()
.getCameraCalibration();
Vec2F size = calibration.getSize();
Vec2F focalLength = calibration.getFocalLength();
float fovyRadians = (float) (2 * Math.atan(0.5f
* size.getData()[1] / focalLength.getData()[1]));
float fovRadians = (float) (2 * Math.atan(0.5f
* size.getData()[0] / focalLength.getData()[0]));
cam.setFovAngle(fovRadians);
cam.setYFovAngle(fovyRadians);
result too bad , when gone away from target , 3d still appear but not moving , and when moving about target , 3d move slow and with bad resolution like 2d
Please tell what i should be aware to make update of 3d
Thanks for your reply