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


Java Eye类代码示例

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


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

示例1: onDrawEye

import com.google.vrtoolkit.cardboard.Eye; //导入依赖的package包/类
/**
 * Draws a frame for an eye.
 *
 * @param eye The eye to render. Includes all required transformations.
 */
@Override
public void onDrawEye(Eye eye) {
    GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT);

    checkGLError("mColorParam");

    // Apply the eye transformation to the camera.
    Matrix.multiplyMM(mView, 0, eye.getEyeView(), 0, mCamera, 0);

    // Set the position of the light
    Matrix.multiplyMV(mLightPosInEyeSpace, 0, mView, 0, LIGHT_POS_IN_WORLD_SPACE, 0);

    // Build the ModelView and ModelViewProjection matrices
    // for calculating cube position and light.
    float[] perspective = eye.getPerspective(Z_NEAR, Z_FAR);
    Matrix.multiplyMM(mModelView, 0, mView, 0, mModelCube, 0);
    Matrix.multiplyMM(mModelViewProjection, 0, perspective, 0, mModelView, 0);
    drawCube();

    // Set mModelView for the floor, so we draw floor in the correct location
    Matrix.multiplyMM(mModelView, 0, mView, 0, mModelFloor, 0);
    Matrix.multiplyMM(mModelViewProjection, 0, perspective, 0,
        mModelView, 0);
    drawFloor();
}
 
开发者ID:kothuri2,项目名称:MoleculeVR,代码行数:31,代码来源:MainActivity.java

示例2: onDrawEye

import com.google.vrtoolkit.cardboard.Eye; //导入依赖的package包/类
/**
 * Draws a frame for an eye.
 *
 * @param eye The eye to render. Includes all required transformations.
 */
@Override
public void onDrawEye(Eye eye) {
    GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT);

    checkGLError("mColorParam");

    // Apply the eye transformation to the camera.
    Matrix.multiplyMM(mView, 0, eye.getEyeView(), 0, mCamera, 0);

    // Build the ModelView and ModelViewProjection matrices
    // for calculating cube position and light.
    float[] perspective = eye.getPerspective(Z_NEAR, Z_FAR);
    Matrix.multiplyMM(mModelView, 0, mView, 0, mModelCube, 0);
    Matrix.multiplyMM(mModelViewProjection, 0, perspective, 0, mModelView, 0);
    drawCube();
    drawPointer();
}
 
开发者ID:zerohun,项目名称:CardboardWebBrowser,代码行数:23,代码来源:MainActivity.java

示例3: onDrawEye

import com.google.vrtoolkit.cardboard.Eye; //导入依赖的package包/类
/**
 * Draws a frame for an eye.
 *
 * @param eye The eye to render. Includes all required transformations.
 */
@Override
public void onDrawEye(Eye eye) {
  GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT);

  checkGLError("colorParam");

  // Apply the eye transformation to the camera.
  Matrix.multiplyMM(view, 0, eye.getEyeView(), 0, camera, 0);

  // Set the position of the light
  Matrix.multiplyMV(lightPosInEyeSpace, 0, view, 0, LIGHT_POS_IN_WORLD_SPACE, 0);

  // Build the ModelView and ModelViewProjection matrices
  // for calculating cube position and light.
  float[] perspective = eye.getPerspective(Z_NEAR, Z_FAR);
  Matrix.multiplyMM(modelView, 0, view, 0, modelCube, 0);
  Matrix.multiplyMM(modelViewProjection, 0, perspective, 0, modelView, 0);
  drawCube();

  // Set modelView for the floor, so we draw floor in the correct location
  Matrix.multiplyMM(modelView, 0, view, 0, modelFloor, 0);
  Matrix.multiplyMM(modelViewProjection, 0, perspective, 0,
    modelView, 0);
  drawFloor();
}
 
开发者ID:ArcadiusK,项目名称:techcrunch-disrupt-esri-android,代码行数:31,代码来源:MainActivity.java

示例4: onDrawEye

import com.google.vrtoolkit.cardboard.Eye; //导入依赖的package包/类
/**
 * Draws a frame for an eye.
 *
 * @param eye The eye to render. Includes all required transformations.
 */
@Override
public void onDrawEye(Eye eye) {

    // float[] scratch = new float[16];
    //    long time = SystemClock.uptimeMillis() % 4000L;
    //    float angle = 0.090f * ((int) time);
    //   Matrix.setRotateM(mRotationMatrix, 0, angle, 0, 1, 0.0f);

    GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT);
    Matrix.multiplyMM(mView, 0, eye.getEyeView(), 0, mCamera, 0);
    multiplyMM(mViewProjectionMatrix, 0, mProjectionMatrix, 0, mView, 0);
    //   multiplyMM(mViewProjectionMatrix, 0, mProjectionMatrix, 0, mCamera, 0);
    //  multiplyMM(scratch, 0, mViewProjectionMatrix, 0, mRotationMatrix, 0);

    mSphere.draw(mViewProjectionMatrix);

    checkGLError("onDrawEye");

}
 
开发者ID:gkortsaridis,项目名称:GoogleCardboardPhotoSphere-VR-,代码行数:25,代码来源:MainActivity.java

示例5: onDrawEye

import com.google.vrtoolkit.cardboard.Eye; //导入依赖的package包/类
@Override
    public void onDrawEye(Eye eye) {
        synchronized (MotionTrackingActivity.sharedLock) {
            GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT);
            mTrajectory.draw(getViewMatrix(), mProjectionMatrix);
            mFloorGrid.draw(getViewMatrix(), mProjectionMatrix);
            mCameraFrustumAndAxis.draw(getViewMatrix(), mProjectionMatrix);
        }
/*
        GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT);
        checkGLError("mColorParam");
        // Apply the eye transformation to the camera.
        Matrix.multiplyMM(mView, 0, eye.getEyeView(), 0, mCamera, 0);
        // Set the position of the light
        Matrix.multiplyMV(mLightPosInEyeSpaceVR, 0, mView, 0, LIGHT_POS_IN_WORLD_SPACE, 0);
        // Build the ModelView and ModelViewProjection matrices
        // for calculating cube position and light.
        float[] perspective = eye.getPerspective(Z_NEAR, Z_FAR);
        Matrix.multiplyMM(mModelView, 0, mView, 0, mModelCube, 0);
        Matrix.multiplyMM(mModelViewProjection, 0, perspective, 0, mModelView, 0);
*/
    }
 
开发者ID:dariol,项目名称:MotionTrackingJavaVR,代码行数:23,代码来源:MTGLRenderer.java

示例6: draw

import com.google.vrtoolkit.cardboard.Eye; //导入依赖的package包/类
@Override
public void draw(Eye eye) {

    if(showUpButton) {
        drawUp(eye);
    }

    for (int i = 0; i < adapter.getCount(); i++) {
        requestView(i);
        if(isViewVisible(i)) {
            updateViewPosition(i);
            View3D v = requestView(i);
            if(v != null) {
                v.draw(eye);
            }
        }
    }

    if(showDownButton) {
        drawDown(eye);
    }

    if(invalidateFlag)
    {
        this.views = null;
        invalidateFlag = false;
    }
}
 
开发者ID:triforce930,项目名称:cardboard_ui_framework,代码行数:29,代码来源:AdapterView3D.java

示例7: draw

import com.google.vrtoolkit.cardboard.Eye; //导入依赖的package包/类
@Override
public void draw(Eye eye) {
    drawLeft(eye);
    drawRight(eye);
    for(int i = 0; i < adapter.getCount(); i++)
    {
        if(isViewVisible(i)) {
            updateViewPosition(i);
            requestView(i).draw(eye);
        }
    }
}
 
开发者ID:triforce930,项目名称:cardboard_ui_framework,代码行数:13,代码来源:GridView3D.java

示例8: draw

import com.google.vrtoolkit.cardboard.Eye; //导入依赖的package包/类
public void draw(Eye eye)
{
    if(showTitle) {
        drawTitle(eye);
    }
    drawContent(eye);
}
 
开发者ID:triforce930,项目名称:cardboard_ui_framework,代码行数:8,代码来源:ViewContent.java

示例9: drawTitle

import com.google.vrtoolkit.cardboard.Eye; //导入依赖的package包/类
private void drawTitle(Eye eye)
{
    if(titleText == null) {
        titleText = new TextView3D(context, name);
        titleText.measure();
        titleText.scale(0.4f, 0.4f, 0.4f);
        titleText.translate(-titleText.getWidth() / titleText.getHeight() / 2, 3.0f, 0.0f);
    }
    titleText.draw(eye);
}
 
开发者ID:triforce930,项目名称:cardboard_ui_framework,代码行数:11,代码来源:ViewContent.java

示例10: onDrawEye

import com.google.vrtoolkit.cardboard.Eye; //导入依赖的package包/类
@Override
public void onDrawEye(Eye eye) {
    if(resetCameraFlag)
    {
        float[] invertedEye = new float[16];
        Matrix.invertM(invertedEye, 0, eye.getEyeView(), 0);
        setUpCamera();
        Matrix.multiplyMM(mCameraMatrix, 0, invertedEye, 0, mCameraMatrix, 0);
        resetCameraFlag = false;
    }
    GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT);

    if(lockCameraFlag) {
        mViewMatrix = mCameraMatrix.clone();
    }else{
        Matrix.multiplyMM(mViewMatrix, 0, eye.getEyeView(), 0, mCameraMatrix, 0);
    }



    Matrix.multiplyMV(mLightPosInWorldSpace, 0, mLightModelMatrix, 0, mLightPosInModelSpace, 0);
    Matrix.multiplyMV(mLightPosInEyeSpace, 0, mViewMatrix, 0, mLightPosInWorldSpace, 0);

    mProjectionMatrix = eye.getPerspective(Z_NEAR, Z_FAR);

    GLES20.glUseProgram(mProgramHandle);
    currentContent.draw(eye);

    if(drawRedPoint) {
        drawTargetingPoint();
    }
    Util.checkGLError("Error Draw Eye");
}
 
开发者ID:triforce930,项目名称:cardboard_ui_framework,代码行数:34,代码来源:CardboardUIActivity.java

示例11: onDrawEye

import com.google.vrtoolkit.cardboard.Eye; //导入依赖的package包/类
@Override
public void onDrawEye(Eye eye) {
    GLES20.glEnable(GLES20.GL_DEPTH_TEST);
    GLES20.glEnable(GLES20.GL_CULL_FACE);
    GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT);

    float[] perspective = eye.getPerspective(Z_NEAR, Z_FAR);

    Matrix.multiplyMM(mTexView, 0, eye.getEyeView(), 0, camera, 0);
    Matrix.multiplyMM(mTexModelView, 0, mTexView, 0, mModel, 0);
    Matrix.multiplyMM(mTexMVP, 0, perspective, 0, mTexModelView, 0);

    drawSphere();
}
 
开发者ID:LGDeveloper,项目名称:FriendsCameraSDK-android,代码行数:15,代码来源:ImageRenderer.java

示例12: onDrawEye

import com.google.vrtoolkit.cardboard.Eye; //导入依赖的package包/类
@Override
public void onDrawEye(Eye eye) {
    GLES20.glEnable(GLES20.GL_DEPTH_TEST);
    GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT);
    VrUtils.checkGLError("colorParam");
    Matrix.multiplyMM(view, 0, eye.getEyeView(), 0, camera, 0);

    float[] perspective = eye.getPerspective(Z_NEAR, Z_FAR);

    Matrix.multiplyMM(modelView, 0, view, 0, modelSphere, 0);
    Matrix.multiplyMM(modelViewProjection, 0, perspective, 0, modelView, 0);

    drawSphere();
}
 
开发者ID:LGDeveloper,项目名称:FriendsCameraSDK-android,代码行数:15,代码来源:VideoRenderer.java

示例13: onDrawEye

import com.google.vrtoolkit.cardboard.Eye; //导入依赖的package包/类
@Override
public void onDrawEye (Eye eye) {
   if (!(app.getApplicationListener() instanceof CardBoardGame)) {
      throw new RuntimeException("should implement CardBoardApplicationListener");
   }
   if (!disposed) {
     ((CardBoardGame) app.getApplicationListener())
             .onDrawEye(eye);
 }
}
 
开发者ID:raphaelbruno,项目名称:ZombieInvadersVR,代码行数:11,代码来源:CardBoardGraphics.java

示例14: onDrawEye

import com.google.vrtoolkit.cardboard.Eye; //导入依赖的package包/类
@Override
public void onDrawEye(Eye eye) {

    // Apply the eye transformation to the camera
    eyeMatrix.setAll(eye.getEyeView());
    eyeQuaternion.fromMatrix(eyeMatrix);
    getCurrentCamera().setOrientation(eyeQuaternion);

    render(ellapsedRealtime, deltaTime);
}
 
开发者ID:sujitkjha,项目名称:360-Video-Player-for-Android,代码行数:11,代码来源:RajawaliCardboardRenderer.java

示例15: onDrawEye

import com.google.vrtoolkit.cardboard.Eye; //导入依赖的package包/类
/**
 * Draws a frame for an eye.
 *
 * @param eye The eye to render. Includes all required transformations.
 */
@Override
public void onDrawEye(Eye eye) {
  GLES20.glEnable(GLES20.GL_DEPTH_TEST);
  GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT);
  GLES20.glEnable(GLES20.GL_CULL_FACE);
  GLES20.glCullFace(GLES20.GL_BACK);

  checkGLError("colorParam");

  // Apply the eye transformation to the camera.
  Matrix.multiplyMM(view, 0, eye.getEyeView(), 0, camera, 0);

  // Set the position of the light
  Matrix.multiplyMV(lightPosInEyeSpace, 0, view, 0, LIGHT_POS_IN_WORLD_SPACE, 0);

  float[] perspective = eye.getPerspective(Z_NEAR, Z_FAR);

  checkGLError("Before drawing notes");
  int i = 0;
  for (Note o : notes) {
    o.drawNote(view, perspective, lightPosInEyeSpace);
    i++;
    checkGLError("drew a note " + i);
  }
  checkGLError("After drawing notes");

  // Set modelView for the floor, so we draw floor in the correct location
  Matrix.multiplyMM(modelView, 0, view, 0, modelFloor, 0);
  checkGLError("Multiplied once");
  Matrix.multiplyMM(modelViewProjection, 0, perspective, 0, modelView, 0);
  checkGLError("Before drawing floor");
  drawFloor();
}
 
开发者ID:grahamrob,项目名称:note60,代码行数:39,代码来源:MainActivity.java


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