// 当前渲染相机的参数
    QGlobalCamera* curRenderCamera = _getWorld()->getMainCam();
    const Matrix4& matView = curRenderCamera->_getCamMatView();
    float zNear = curRenderCamera->getNearClipDistance();
    float fovYHalf = curRenderCamera->getFOVy().valueRadians() * 0.5f;
    float tanFov = Math::Tan(fovYHalf);
    float asp = curRenderCamera->getAspectRatio();
    float heightNear = tanFov * zNear * 2;
    float widthNear = asp * heightNear;
    float screenMaxSize = std::max( widthNear, heightNear );

// 自己的参数
    Vector3 rsPos = _getRSPosWorld();
    Vector3 posInViewSpace = matView * rsPos;
    float zView = -posInViewSpace.z;

// 调节
    const float projRef = 0.1f * screenMaxSize; // 要求占屏幕大小比例

float zViewMin = zNear + 0.01f;
    if ( zView < zViewMin )
        zView = zViewMin;

float projRefLong = Math::Sqrt( zNear * zNear + projRef * projRef );

// ref / ref_l = r / z_view
    float r = projRef / projRefLong * zView;
    float s_adj = r / AXIS_LEN;
    Vector3 v_adj(s_adj);

render same axis的更多相关文章

  1. 验证occ和vtk整合工作的demo

    在编译occ通过过后,我需要验证occ是否能够正常结合vtk进行开发工作 使用CMake进行环境变量设置: CMakeList.txt PROJECT (IGESReader) #VTK Part: ...

  2. [D3] Animate Chart Axis Transitions in D3 v4

    When the data being rendered by a chart changes, sometimes it necessitates a change to the scales an ...

  3. IVIEW组件的render方法在Table组件中的使用

    后端项目地址:https://gitee.com/wlovet/table-server 前端项目地址:  https://gitee.com/wlovet/table-project 一.Rende ...

  4. React.render和reactDom.render的区别

    刚开始学习react.js.发现网上的资料,有些是写着react.render,有些写着reactDom.render.觉得很奇怪就查阅了一下资料.解释如下: 这个是react最新版api,也就是0. ...

  5. 应用Apache Axis进行Web Service开发

    转自(http://tscjsj.blog.51cto.com/412451/84813) 一.概述 SOAP原意为Simple Object Access Protocol(简单对象访问协议),是一 ...

  6. 有理数的稠密性(The rational points are dense on the number axis.)

    每一个实数都能用有理数去逼近到任意精确的程度,这就是有理数的稠密性.The rational points are dense on the number axis.

  7. XF custom render 各平台实现类

    目前的XF还是非常简陋的,所以存在大量的自定义工作.一般情况下我们只是要需要派生原生的XF控件,然后在各平台下修改其呈现方法. 所以了解每个XF控件在不同平台上呈现使用的控件类是有所必须要的.以下别人 ...

  8. 使用axis开发web service服务端

    一.axis环境搭建 1.安装环境 JDK.Tomcat或Resin.eclipse等. 2.到 http://www.apache.org/dyn/closer.cgi/ws/axis/1_4下载A ...

  9. 塞翁失马,焉知非福:由 Styles.Render 所引发 runAllManagedModulesForAllRequests="true" 的思考

    最近在使用 MVC 开发的时候,遇到一个对我来说"奇怪的问题",就是使用 BundleTable 进行 CSS.JS 文件绑定,然后使用 Styles.Render.Scripts ...

随机推荐

  1. 【Codeforces 1042D】Petya and Array

    [链接] 我是链接,点我呀:) [题意] 题意 [题解] 把a[i]处理成前缀和 离散化. 枚举i从1..n假设a[i]是区间和的a[r] 显然我们需要找到a[r]-a[l]<t的l的个数 即a ...

  2. webview的设置

    设置支持js: webView.getSettings().setJavaScriptEnabled(true); 设置无图模式: webView.getSettings().setBlockNetw ...

  3. Educational Codeforces Round 45 (Rated for Div. 2) C、D

      C. Bracket Sequences Concatenation Problem time limit per test 2 seconds memory limit per test 256 ...

  4. 选择器(E:hover/E:active/E:focus的使用)

    <!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head><meta ...

  5. JSTL-XML标签库

    主页:http://www.cnblogs.com/EasonJim/p/6958992.html的分支页. 一.<x:out> <x:out>标签显示XPath表达式的结果, ...

  6. 如何使用python书写守护进程?daemon、python-daemon

    可以参考的supervisor实现:https://github.com/Supervisor/supervisor:http://supervisord.org/configuration.html ...

  7. cakephp2.3.8中何为component

    大胆假设,小心求证         记得这句话是以前读高三的时候,一个数学老师(圆头,有点胖胖的老师,不是很记得),经常挂在嘴边的一句话, 对于我们不理解,或者说是无法确定的东西,我们不妨先大胆地去假 ...

  8. 制作svg动画

    要实现一步一步画出来一个图片,css3做不到吧.除非一张张的图片定时显示.想不到别的招了.如今用的是一个插件,做了一个svg动画. 插件地址:http://lazylinepainter.info/ ...

  9. 我怎么在AD里面找到已经改名的Administrator账户?

    近期有博友问我一个问题,他是一个企业里面的IT管理员,他非常苦恼.他是一个新手,之前管理员交接的时候,没有交接更改的管理员username和password.他如今不知道哪个才是系统之前内置的admi ...

  10. eclipse中j2ee(struts2)部署及相关问题释疑

    1.eclipse中进行web项目开发时.部署的时候和利用myeclipse部署时有非常大不同,由于在myeclipse的工具栏中有一个部署button.而且在myeclipse的preference ...