• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java HeadTransform类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.google.vrtoolkit.cardboard.HeadTransform的典型用法代码示例。如果您正苦于以下问题:Java HeadTransform类的具体用法?Java HeadTransform怎么用?Java HeadTransform使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



HeadTransform类属于com.google.vrtoolkit.cardboard包,在下文中一共展示了HeadTransform类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onNewFrame

import com.google.vrtoolkit.cardboard.HeadTransform; //导入依赖的package包/类
/**
 * Prepares OpenGL ES before we draw a frame.
 *
 * @param headTransform The head transformation in the new frame.
 */
@Override
public void onNewFrame(HeadTransform headTransform) {
  //add all the new notes the next frame
  while (!newNotes.isEmpty()) {
    float[] newNote = newNotes.poll();
    notes.add(new Note("", noteProgram, newNote[0], newNote[1], newNote[2]));
  }
  // Build the camera matrix and apply it to the ModelView.
  Matrix.setLookAtM(camera, 0, 0.0f, 0.0f, CAMERA_Z, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);

  headTransform.getHeadView(headView, 0);

  headTransform.getForwardVector(headForward, 0);

  checkGLError("onReadyToDraw");
}
 
开发者ID:grahamrob,项目名称:note60,代码行数:22,代码来源:MainActivity.java


示例2: onNewFrame

import com.google.vrtoolkit.cardboard.HeadTransform; //导入依赖的package包/类
/**
 * Prepares OpenGL ES before we draw a frame.
 *
 * @param headTransform The head transformation in the new frame.
 */
@Override
public void onNewFrame(HeadTransform headTransform) {
  // Build the Model part of the ModelView matrix.
  Matrix.rotateM(modelCube, 0, TIME_DELTA, 0.5f, 0.5f, 1.0f);

  // Build the camera matrix and apply it to the ModelView.
  Matrix.setLookAtM(camera, 0, 0.0f, 0.0f, CAMERA_Z, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);

  headTransform.getHeadView(headView, 0);

  // Update the 3d audio engine with the most recent head rotation.
  headTransform.getQuaternion(headRotation, 0);

  checkGLError("onReadyToDraw");
}
 
开发者ID:openforeveryone,项目名称:CardboardStereoVideo,代码行数:21,代码来源:MainActivity.java


示例3: onNewFrame

import com.google.vrtoolkit.cardboard.HeadTransform; //导入依赖的package包/类
/**
 * Prepares OpenGL ES before we draw a frame.
 *
 * @param headTransform The head transformation in the new frame.
 */
@Override
public void onNewFrame(HeadTransform headTransform) {
    // Build the camera matrix and apply it to the ModelView.
    Matrix.setLookAtM(mCamera, 0, 0.0f, 0.0f, CAMERA_Z, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);

    headTransform.getHeadView(mHeadView, 0);
    getFocusIntersectionVertex(mIntersectionPointerVertex, WorldLayoutData.SQURE_VERTEX, WorldLayoutData.SQUARE_NORMAL);
    mIntersectionPointerVertices = getPointerCoordinate(mIntersectionPointerVertex);
    ByteBuffer bbVertices = ByteBuffer.allocateDirect(mIntersectionPointerVertices.length * 4);
    bbVertices.order(ByteOrder.nativeOrder());
    mFbIntersectionPointerVertices = bbVertices.asFloatBuffer();
    mFbIntersectionPointerVertices.put(mIntersectionPointerVertices);
    mFbIntersectionPointerVertices.position(0);

    synchronized(this) {
        mSurface.updateTexImage();
        mSurface.getTransformMatrix(mSTMatrix);
    }

    checkGLError("onReadyToDraw");
}
 
开发者ID:zerohun,项目名称:CardboardWebBrowser,代码行数:27,代码来源:MainActivity.java


示例4: onNewFrame

import com.google.vrtoolkit.cardboard.HeadTransform; //导入依赖的package包/类
@Override
public void onNewFrame(HeadTransform headTransform) {
    // Draw background color
    GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT);

    headAngleXZ = extractAngleXZFromHeadtransform(headTransform);
    headAngleYZ = extractAngleYZFromHeadtransform(headTransform);
    headAngleXY = extractAngleXYFromHeadtransform(headTransform);

    while( headAngleXZ < 0 ) {
        headAngleXZ += 360.0;
    }

    while( headAngleXZ > 360 ) {
        headAngleXZ -= 360.0;
    }
}
 
开发者ID:TheFakeMontyOnTheRun,项目名称:adapting-OpenGLES2-sample-into-cardboard,代码行数:18,代码来源:MyGLRenderer.java


示例5: onNewFrame

import com.google.vrtoolkit.cardboard.HeadTransform; //导入依赖的package包/类
/**
 * Prepares OpenGL ES before we draw a frame.
 *
 * @param headTransform The head transformation in the new frame.
 */
@Override
public void onNewFrame(HeadTransform headTransform) {
  // Build the Model part of the ModelView matrix.
  /*Matrix.rotateM(modelCube, 0, TIME_DELTA, 0.5f, 0.5f, 1.0f);
    Matrix.rotateM(modelCube2, 0, TIME_DELTA, 0.5f, 0.5f, 1.0f);*/

    for (int i = 0; i < modelCubes.length; i++)
    {
        Matrix.rotateM(modelCubes[i], 0, TIME_DELTA, 0.5f, 0.5f, 1.0f);
    }

  // Build the camera matrix and apply it to the ModelView.
  Matrix.setLookAtM(camera, 0, 0.0f, 0.0f, CAMERA_Z, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);

  headTransform.getHeadView(headView, 0);

  checkGLError("onReadyToDraw");
}
 
开发者ID:Shounak,项目名称:InSight-HackHarvard,代码行数:24,代码来源:MainActivity.java


示例6: onNewFrame

import com.google.vrtoolkit.cardboard.HeadTransform; //导入依赖的package包/类
/**
 * Prepares OpenGL ES before we draw a frame.
 *
 * @param headTransform The head transformation in the new frame.
 */
@Override
public void onNewFrame(HeadTransform headTransform) {
    // Build the camera matrix and apply it to the ModelView.
    Matrix.setLookAtM(camera.values, 0, 0.0f, 0.0f, CAMERA_Z, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);
    checkGLError("onReadyToDraw");

    headAngleXZ = extractAngleXZFromHeadtransform(headTransform);
    headAngleYZ = extractAngleYZFromHeadtransform(headTransform);
    headAngleXY = extractAngleXYFromHeadtransform(headTransform);

    if ( this.useVRMode ) {
        cameraNode.angleXZ = headAngleXZ;

        while( cameraNode.angleXZ < 0 ) {
            cameraNode.angleXZ += 360.0;
        }

        while( cameraNode.angleXZ > 360 ) {
            cameraNode.angleXZ -= 360.0;
        }
    }
}
 
开发者ID:TheFakeMontyOnTheRun,项目名称:droidhunterredux,代码行数:28,代码来源:CardboardRenderer.java


示例7: onNewFrame

import com.google.vrtoolkit.cardboard.HeadTransform; //导入依赖的package包/类
@Override
public void onNewFrame(HeadTransform arg0) {
	GLES20.glUseProgram(mProgramHandle);
	mMVPMatrixHandle = GLES20.glGetUniformLocation(mProgramHandle, "uMVPMatrix");
	mTexUniformHandle = GLES20.glGetUniformLocation(mProgramHandle, "u_Texture");
	mTexColorMultHandle = GLES20.glGetUniformLocation(mProgramHandle, "f_extOESTexColorMult");
	m2DTexUniformHandle = GLES20.glGetUniformLocation(mProgramHandle, "u_2DTexture");
	m2DTexColorMultHandle = GLES20.glGetUniformLocation(mProgramHandle, "f_2DTexColorMult");
	mColorHandle = GLES20.glGetUniformLocation(mProgramHandle, "f_colorMult");
	mPositionHandle = GLES20.glGetAttribLocation(mProgramHandle, "a_Position");
	mColorHandle = GLES20.glGetAttribLocation(mProgramHandle, "a_Color");
	mTexCoordHandle = GLES20.glGetAttribLocation(mProgramHandle, "a_TexCoordinate");
	
	arg0.getHeadView(mHeadView, 0);
	
	if(mVideoScreen.isPlaying())
	{
		mButtons.get(0).setTextureDataHandle(mTexturePauseDataHandle);
	}else{
		mButtons.get(0).setTextureDataHandle(mTexturePlayDataHandle);
	}
	
	Utils.checkGlError("OnNewFrame");
}
 
开发者ID:triforce930,项目名称:CardboardVideoPlayer,代码行数:25,代码来源:MainActivity.java


示例8: onNewFrame

import com.google.vrtoolkit.cardboard.HeadTransform; //导入依赖的package包/类
@Override
public void onNewFrame(HeadTransform headTransform) {
    headTransform.getHeadView(mHeadViewMatrix, 0);
    headTransform.getForwardVector(mForwardVector, 0);
    currentContent.update();
    Util.checkGLError("Error On New Frame");
}
 
开发者ID:triforce930,项目名称:cardboard_ui_framework,代码行数:8,代码来源:CardboardUIActivity.java


示例9: onNewFrame

import com.google.vrtoolkit.cardboard.HeadTransform; //导入依赖的package包/类
@Override
public void onNewFrame(HeadTransform headTransform) {
    Matrix.setLookAtM(camera, 0, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 0.0f, 1.0f, 0.0f);
    mSurfaceTexture.updateTexImage();
    Matrix.setIdentityM(mSTMatrix, 0);
    mSurfaceTexture.getTransformMatrix(mSTMatrix);

    headTransform.getHeadView(headView, 0);
}
 
开发者ID:LGDeveloper,项目名称:FriendsCameraSDK-android,代码行数:10,代码来源:VideoRenderer.java


示例10: onNewFrame

import com.google.vrtoolkit.cardboard.HeadTransform; //导入依赖的package包/类
@Override
public void onNewFrame(HeadTransform headTransform) {

    view = headTransform.getHeadView();
    if (view != null && perspective != null) {
        super.setOverrideMatrices(view, perspective);
    }

}
 
开发者ID:tangrams,项目名称:tangram-cardboard,代码行数:10,代码来源:CardboardMapController.java


示例11: onNewFrame

import com.google.vrtoolkit.cardboard.HeadTransform; //导入依赖的package包/类
@Override
public void onNewFrame(HeadTransform headTransform) {
    // Build the camera matrix and apply it to the ModelView.
    Matrix.setLookAtM(mCamera, 0, 0.0f, 0.0f, CAMERA_Z, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);

    headTransform.getHeadView(mHeadView, 0);

    mRealCameraTexture.updateTexImage();

    checkGLError("onReadyToDraw");
}
 
开发者ID:cnexus,项目名称:pennapps_instadubb,代码行数:12,代码来源:Renderer.java


示例12: onNewFrame

import com.google.vrtoolkit.cardboard.HeadTransform; //导入依赖的package包/类
/**
 * Prepares OpenGL ES before we draw a frame.
 *
 * @param headTransform The head transformation in the new frame.
 */
@Override
public void onNewFrame(HeadTransform headTransform) {
    // Build the Model part of the ModelView matrix.
    Matrix.rotateM(mModelCube, 0, TIME_DELTA, 0.5f, 0.5f, 1.0f);

    // Build the camera matrix and apply it to the ModelView.
    Matrix.setLookAtM(mCamera, 0, 0.0f, 0.0f, CAMERA_Z, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);

    headTransform.getHeadView(mHeadView, 0);

    checkGLError("onReadyToDraw");
}
 
开发者ID:kothuri2,项目名称:MoleculeVR,代码行数:18,代码来源:MainActivity.java


示例13: onDrawFrame

import com.google.vrtoolkit.cardboard.HeadTransform; //导入依赖的package包/类
@Override
public void onDrawFrame(HeadTransform ht, Eye eye, Eye eye1) {
    ht.getHeadView(temp, 0);
    this.mHeadTransform = ht;
    tempMat.set(temp);
    tempMat.toRotationQuat(orientation);
    tempMat.toTranslationVector(position);
    leftEye = eye;
    rightEye = eye1;
    // apply eye view to camera matrix
    
    
    super.onDrawFrame(null);
}
 
开发者ID:neph1,项目名称:jme-cardboard,代码行数:15,代码来源:CardboardContext.java


示例14: onNewFrame

import com.google.vrtoolkit.cardboard.HeadTransform; //导入依赖的package包/类
/**
 * Prepares OpenGL ES before we draw a frame.
 *
 * @param headTransform The head transformation in the new frame.
 */
@Override
public void onNewFrame(HeadTransform headTransform) {
  // Build the Model part of the ModelView matrix.
  Matrix.rotateM(modelCube, 0, TIME_DELTA, 0.5f, 0.5f, 1.0f);

  // Build the camera matrix and apply it to the ModelView.
  Matrix.setLookAtM(camera, 0, 0.0f, 0.0f, CAMERA_Z, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);

  headTransform.getHeadView(headView, 0);

  checkGLError("onReadyToDraw");
}
 
开发者ID:ArcadiusK,项目名称:techcrunch-disrupt-esri-android,代码行数:18,代码来源:MainActivity.java


示例15: onNewFrame

import com.google.vrtoolkit.cardboard.HeadTransform; //导入依赖的package包/类
/**
 * Prepares OpenGL ES before we draw a frame.
 *
 * @param headTransform The head transformation in the new frame.
 */
@Override
public void onNewFrame(HeadTransform headTransform) {
    // Build the Model part of the ModelView matrix.
    Matrix.rotateM(modelCube, 0, TIME_DELTA, 0.5f, 0.5f, 1.0f);

    // Build the camera matrix and apply it to the ModelView.
    Matrix.setLookAtM(camera, 0, 0.0f, 0.0f, CAMERA_Z, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);

    headTransform.getHeadView(headView, 0);

    checkGLError("onReadyToDraw");
}
 
开发者ID:skylight1,项目名称:VR-Map-Explorer,代码行数:18,代码来源:MainActivity.java


示例16: onNewFrame

import com.google.vrtoolkit.cardboard.HeadTransform; //导入依赖的package包/类
@Override
    public void onNewFrame(HeadTransform headTransform) {
        // Build the Model part of the ModelView matrix.
//        Matrix.rotateM(mModelCube, 0, TIME_DELTA, 0.5f, 0.5f, 1.0f);
        // Build the camera matrix and apply it to the ModelView.
//        Matrix.setLookAtM(mCamera, 0, 0.0f, 0.0f, CAMERA_Z, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);
//        headTransform.getHeadView(mHeadView, 0);
        checkGLError("onReadyToDraw");
    }
 
开发者ID:dariol,项目名称:MotionTrackingJavaVR,代码行数:10,代码来源:MTGLRenderer.java


示例17: onNewFrame

import com.google.vrtoolkit.cardboard.HeadTransform; //导入依赖的package包/类
/**
 * Prepares OpenGL ES before we draw a frame.
 *
 * @param headTransform The head transformation in the new frame.
 */
@Override
public void onNewFrame(HeadTransform headTransform) {

    /** Setting the camera in the center **/
    Matrix.setLookAtM(mCamera, 0, 0.0f, 0.0f, CAMERA_Z, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);
    checkGLError("onReadyToDraw");
}
 
开发者ID:pollux-,项目名称:GoogleCardBoardVr-360-PhotoSphere,代码行数:13,代码来源:MainActivity.java


示例18: onDrawFrame

import com.google.vrtoolkit.cardboard.HeadTransform; //导入依赖的package包/类
@Override
public void onDrawFrame(HeadTransform headTransform, Eye eye, Eye eye1) {
    float[] quaternion = new float[4];
    headTransform.getQuaternion(quaternion, 0);

    float x = quaternion[0];
    float y = quaternion[1];
    float z = quaternion[2];
    float w = quaternion[3];
    float roll  = (float)Math.atan2(2*y*w - 2*x*z, 1 - 2*y*y - 2*z*z);
    float pitch = (float)Math.atan2(2*x*w - 2*y*z, 1 - 2*x*x - 2*z*z);
    float yaw   = (float)Math.asin(2*x*y + 2*z*w);

    Log.v(TAG, String.format("onNewFrame p=%f, y=%f", pitch, roll));

    if (!attitudeInitialized) {
        attitudeInitialized = true;
        currentYaw = roll;
        currentPitch = pitch;
    }
    float relYaw = currentYaw - roll;
    float rotSpeed = Math.max(-1, Math.min(+1, relYaw * 8.0f));
    float speed;
    if (pitch > 0) {
        speed = Math.min(+1.0f, pitch * 2.0f);
    } else {
        speed = Math.max(-1.0f, pitch * 1.0f);
    }
    synchronized (sumoClient.session.move) {
        if (running) {
            sumoClient.session.move.rotation = (byte) (rotSpeed * 127);
            sumoClient.session.move.speed = (byte) (speed * 127);
        } else {
            sumoClient.session.move.rotation = 0;
            sumoClient.session.move.speed = 0;
        }
    }
    currentYaw = roll;
    currentPitch = pitch;
}
 
开发者ID:psyark,项目名称:CardboardSumo,代码行数:41,代码来源:FullscreenActivity.java


示例19: onNewFrame

import com.google.vrtoolkit.cardboard.HeadTransform; //导入依赖的package包/类
@Override
public void onNewFrame(HeadTransform headTransform) {
    Matrix.setLookAtM(camera, 0, 0.0f, 0.0f, CAMERA_Z, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);
    VrUtils.checkGLError("onReadyToDraw");
}
 
开发者ID:LGDeveloper,项目名称:FriendsCameraSDK-android,代码行数:6,代码来源:ImageRenderer.java


示例20: onNewFrame

import com.google.vrtoolkit.cardboard.HeadTransform; //导入依赖的package包/类
@Override
public void onNewFrame(HeadTransform headTransform) {
    super.onRenderFrame(null);
}
 
开发者ID:sujitkjha,项目名称:360-Video-Player-for-Android,代码行数:5,代码来源:RajawaliCardboardRenderer.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AuthenticationUser类代码示例发布时间:2022-05-21
下一篇:
Java Canonicalizer20010315OmitComments类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap