本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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");
}
示例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);
*/
}
示例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;
}
}
示例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);
}
}
}
示例8: draw
import com.google.vrtoolkit.cardboard.Eye; //导入依赖的package包/类
public void draw(Eye eye)
{
if(showTitle) {
drawTitle(eye);
}
drawContent(eye);
}
示例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);
}
示例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");
}
示例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();
}
示例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();
}
示例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);
}
}
示例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);
}
示例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();
}