当前位置: 首页>>代码示例>>Java>>正文


Java TangoPoseData.getRotationAsFloats方法代码示例

本文整理汇总了Java中com.google.atap.tangoservice.TangoPoseData.getRotationAsFloats方法的典型用法代码示例。如果您正苦于以下问题:Java TangoPoseData.getRotationAsFloats方法的具体用法?Java TangoPoseData.getRotationAsFloats怎么用?Java TangoPoseData.getRotationAsFloats使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.atap.tangoservice.TangoPoseData的用法示例。


在下文中一共展示了TangoPoseData.getRotationAsFloats方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateRenderCameraPose

import com.google.atap.tangoservice.TangoPoseData; //导入方法依赖的package包/类
/**
 * Update the scene camera based on the provided pose in Tango start of service frame.
 * The camera pose should match the pose of the camera color at the time the last rendered RGB
 * frame, which can be retrieved with this.getTimestamp();
 * <p/>
 * NOTE: This must be called from the OpenGL render thread - it is not thread safe.
 */
public void updateRenderCameraPose(TangoPoseData cameraPose) {
    float[] rotation = cameraPose.getRotationAsFloats();
    float[] translation = cameraPose.getTranslationAsFloats();
    Quaternion quaternion = new Quaternion(rotation[3], rotation[0], rotation[1], rotation[2]);
    // Conjugating the Quaternion is need because Rajawali uses left handed convention for
    // quaternions.
    getCurrentCamera().setRotation(quaternion.conjugate());
    getCurrentCamera().setPosition(translation[0], translation[1], translation[2]);
}
 
开发者ID:tdb-alcorn,项目名称:defect-party,代码行数:17,代码来源:FloorplanRenderer.java

示例2: logPose

import com.google.atap.tangoservice.TangoPoseData; //导入方法依赖的package包/类
/**
 * Log the Position and Orientation of the given pose in the Logcat as information.
 *
 * @param pose the pose to log.
 */
private void logPose(TangoPoseData pose) {
    StringBuilder stringBuilder = new StringBuilder();

    float translation[] = pose.getTranslationAsFloats();
    stringBuilder.append("Position: " +
            translation[0] + ", " + translation[1] + ", " + translation[2]);

    float orientation[] = pose.getRotationAsFloats();
    stringBuilder.append(". Orientation: " +
            orientation[0] + ", " + orientation[1] + ", " +
            orientation[2] + ", " + orientation[3]);

    Log.i(TAG, stringBuilder.toString());
}
 
开发者ID:max2dn,项目名称:TangoTest,代码行数:20,代码来源:HelloMotionTrackingActivity.java


注:本文中的com.google.atap.tangoservice.TangoPoseData.getRotationAsFloats方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。