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


Java HeadTransform类代码示例

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


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


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