Add 3dview template class, port calibration from c to java