本文整理汇总了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");
}
示例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");
}
示例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");
}
示例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");
}
示例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;
}
}
}
示例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");
}
示例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");
}
示例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);
}
示例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);
}
}
示例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");
}
示例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");
}
示例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);
}
示例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");
}
示例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");
}