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

Java Viewport类代码示例

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

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



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

示例1: onFinishFrame

import com.google.vr.sdk.base.Viewport; //导入依赖的package包/类
@Override
public void onFinishFrame(Viewport viewport) {
}
 
开发者ID:mobialia,项目名称:jmini3d-vr-demo,代码行数:4,代码来源:VRActivity.java


示例2: onFinishFrame

import com.google.vr.sdk.base.Viewport; //导入依赖的package包/类
@Override
public void onFinishFrame(Viewport viewport) {}
 
开发者ID:codedavid,项目名称:PanoramaGL,代码行数:3,代码来源:TreasureHuntActivity.java


示例3: onDrawEye

import com.google.vr.sdk.base.Viewport; //导入依赖的package包/类
@Override
    public void onDrawEye(Eye eye) {
        Viewport curView = eye.getViewport();
        Viewport initViewport = new Viewport();
        initViewport.setViewport(curView.x, curView.y, curView.width, curView.height);

        FieldOfView curFov = eye.getFov();
        FieldOfView initFov = new FieldOfView(curFov.getLeft(), curFov.getRight(), curFov.getBottom(), curFov.getTop());

        // Change to camera resolution for scene render
        eye.getViewport().setViewport(0, 0, mPreviewSize.getWidth(), mPreviewSize.getHeight());
        eye.getFov().setAngles((float)mFov.x / 2.0f, (float)mFov.x / 2.0f, (float)mFov.y / 2.0f, (float)mFov.y / 2.0f);
        eye.getViewport().setGLViewport();
        eye.getViewport().setGLScissor();
        eye.setProjectionChanged();

        // Apply the eye transformation to the camera.
        float[] viewMat = new float[16];
        Matrix.multiplyMM(viewMat, 0, eye.getEyeView(), 0, mCamera, 0);
        // Get the perspective matrix for 3D objects rendering
        // Create FOV identical to physical
        float[] perspective = new float[16];
        perspective = eye.getPerspective(Z_NEAR, Z_FAR);
        //Matrix.perspectiveM(perspective, 0, (float)mFov.y, (float)mPreviewSize.getWidth() / (float)mPreviewSize.getHeight(), Z_NEAR, Z_FAR);
//        FieldOfView physFov = new FieldOfView((float)mFov.x, (float)mFov.x, (float)mFov.y, (float)mFov.y);
//        physFov.toPerspectiveMatrix(Z_NEAR, Z_FAR, perspective, 0);

        // First draw object scene texture through frame buffer
        GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, mFboIdObjects);
        if (eye.getType() == Eye.Type.LEFT) {
            GLES20.glClearColor(1.0f, 0.0f, 0.0f, 0.0f);
        } else {
            GLES20.glClearColor(0.0f, 0.0f, 1.0f, 0.0f);
        }
        GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT);
        GLES20.glEnable(GLES20.GL_DEPTH_TEST);
        //GLES20.glViewport(0, 0, mPreviewSize.getWidth(), mPreviewSize.getHeight());
        //GLES20.glViewport(0, 0, 100, 100);

        drawObjects(viewMat, perspective);

        GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, DEFAULT_FBO_ID);

        // Change back to initial res
        eye.getViewport().setViewport(initViewport.x, initViewport.y, initViewport.width, initViewport.height);
        eye.getFov().setAngles(initFov.getLeft(), initFov.getRight(), initFov.getBottom(), initFov.getTop());
        eye.getViewport().setGLViewport();
        eye.getViewport().setGLScissor();
        eye.setProjectionChanged();

        // Recalculate the perspective matrix for vr view
        perspective = eye.getPerspective(Z_NEAR, Z_FAR);
       // Matrix.perspectiveM(perspective, 0, eye.getFov().getTop(), (float)eye.getViewport().width / (float)eye.getViewport().height, Z_NEAR, Z_FAR);

        // Now draw actual screen for cardboard viewer
        GLES20.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
        GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT);
        GLES20.glEnable(GLES20.GL_DEPTH_TEST);
        //eye.getViewport().setGLViewport();

        screenRenderer.draw(viewMat, perspective);
    }
 
开发者ID:davrempe,项目名称:cardboardAR-lib,代码行数:63,代码来源:GarActivity.java


示例4: onFinishFrame

import com.google.vr.sdk.base.Viewport; //导入依赖的package包/类
@Override
public void onFinishFrame(Viewport viewport) {
    //no clue, example code was blank here.
}
 
开发者ID:JimSeker,项目名称:CardBoardVR,代码行数:5,代码来源:myStereoRenderer.java


示例5: onFinishFrame

import com.google.vr.sdk.base.Viewport; //导入依赖的package包/类
@Override
public void onFinishFrame(Viewport viewport) {
    //we are not doing anything after the drawing, but before the display, so nothing here.
}
 
开发者ID:JimSeker,项目名称:CardBoardVR,代码行数:5,代码来源:myStereoRenderer.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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