render same axis
// 当前渲染相机的参数
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的更多相关文章
- 验证occ和vtk整合工作的demo
在编译occ通过过后,我需要验证occ是否能够正常结合vtk进行开发工作 使用CMake进行环境变量设置: CMakeList.txt PROJECT (IGESReader) #VTK Part: ...
- [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 ...
- IVIEW组件的render方法在Table组件中的使用
后端项目地址:https://gitee.com/wlovet/table-server 前端项目地址: https://gitee.com/wlovet/table-project 一.Rende ...
- React.render和reactDom.render的区别
刚开始学习react.js.发现网上的资料,有些是写着react.render,有些写着reactDom.render.觉得很奇怪就查阅了一下资料.解释如下: 这个是react最新版api,也就是0. ...
- 应用Apache Axis进行Web Service开发
转自(http://tscjsj.blog.51cto.com/412451/84813) 一.概述 SOAP原意为Simple Object Access Protocol(简单对象访问协议),是一 ...
- 有理数的稠密性(The rational points are dense on the number axis.)
每一个实数都能用有理数去逼近到任意精确的程度,这就是有理数的稠密性.The rational points are dense on the number axis.
- XF custom render 各平台实现类
目前的XF还是非常简陋的,所以存在大量的自定义工作.一般情况下我们只是要需要派生原生的XF控件,然后在各平台下修改其呈现方法. 所以了解每个XF控件在不同平台上呈现使用的控件类是有所必须要的.以下别人 ...
- 使用axis开发web service服务端
一.axis环境搭建 1.安装环境 JDK.Tomcat或Resin.eclipse等. 2.到 http://www.apache.org/dyn/closer.cgi/ws/axis/1_4下载A ...
- 塞翁失马,焉知非福:由 Styles.Render 所引发 runAllManagedModulesForAllRequests="true" 的思考
最近在使用 MVC 开发的时候,遇到一个对我来说"奇怪的问题",就是使用 BundleTable 进行 CSS.JS 文件绑定,然后使用 Styles.Render.Scripts ...
随机推荐
- [NOIP2007] 普及组
奖学金 模拟 开个struct排序即可 c++吼啊 /*by SilverN*/ #include<algorithm> #include<iostream> #include ...
- 使用XML定义组件样式
<TextView android:layout_width="match_parent" android:layout_height="wrap_content& ...
- 无权二分图最大匹配 HDU2063 匈牙利算法 || Hopcroft-Karp
参考两篇比较好的博客 http://www.renfei.org/blog/bipartite-matching.html http://blog.csdn.net/thundermrbird/art ...
- Codeforces 651C Watchmen【模拟】
题意: 求欧几里得距离与曼哈顿距离相等的组数. 分析: 化简后得到xi=xj||yi=yj,即为求x相等 + y相等 - x与y均相等. 代码: #include<iostream> #i ...
- Ubuntu 16.04安装基于nethogs衍生的网络监控软件(应用实时网速监控)
基于nethogs衍生的网络监控软件有如下所列举的: nettop显示数据包类型,按数据包的大小或数量排序. ettercap是以太网的网络嗅探器/拦截器/记录器 darkstat通过主机,协议等方式 ...
- Python学习系列之format用法
format是代替%s格式的方法 不需要理会数据类型的问题,在%s方法中的%s只能代替字符串类型 填充方式十分灵活,对其方式十分强大 format填充字符串 通过位置来填充字符串 #format会把参 ...
- [Unity3D]Unity3D游戏开发之从Unity3D到Eclipse
---------------------------------------------------------------------------------------------------- ...
- Maven具体解释之仓库------本地仓库、远程仓库
在Maven中,不论什么一个依赖.插件或者项目构建的输出.都能够称之为构件. Maven在某个统一的位置存储全部项目的共享的构件.这个统一的位置.我们就称之为仓库.(仓库就是存放依赖和插件的地方) 不 ...
- Linux Centos7 Apache 訪问 You don't have permission to access / on this server.
折腾了非常久,今天才找到了最正确的答案.感言真不easy. 百度出来的99%都是採集的内容.全都是错误的. You don't have permission to access / on this ...
- SDUT--找朋友(BFS&&DFS)
找朋友 Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^ 题目描写叙述 X,作为户外运动的忠实爱好者,总是不想呆在家里.如今,他想把死宅Y从家 ...