3D objects key rendering steps
Key steps of Rendering objects:
1 Create objects’ meshes, which we can use C++’s vector container to hold them. They just some points structures, and indices(represented by int). Knowing exact what they are can demystify them.
2 Set up transformation matrixes: world matrix, view matrix, and projection matrix.
1) World matrix is identity matrix;
2) View matrix is caculated with three matrix, which can be done with one intrinsic function in DirectX:
// Build the view matrix.
XMVECTOR pos = XMVectorSet(x, y, z, 1.0f);
XMVECTOR target = XMVectorZero();
XMVECTOR up = XMVectorSet(0.0f, 1.0f, 0.0f, 0.0f); XMMATRIX V = XMMatrixLookAtLH(pos, target, up);
3) Projection matrix, which is also called perspective projection matrix, can be calculated with one intrinsic function in DirectX, too:
XMMATRIX P = XMMatrixPerspectiveFovLH(0.25f*MathHelper::Pi, AspectRatio(), 1.0f, 1000.0f);
The math behind them can be very complicated. And sometime we may need to know them to perfrom some specific effects.
If we want to move our objects to some specific position and have specific orientation, we can use RST(rotation matrix, scaling matrix, and translation matrix) to transform our objects. And we can multiply RST with world matrix, like this: W = W*RST; and then use the new W as other non-transformed objects.
3 Create buffers to hold, majorly, vertice and indices, we call them vertics buffer and indices buffer, and then we must bind the buffers to our drawing context, so that our DirectX know what to draw.
4 Remember to set up our vertex layout, which mean we have to specify how to arrange our vertices, is it a vertex with color, normal, or even with texture coordinate? We have to make every thing crystal clear, otherwise computer just never know how to do it.
5 We have to watch out what variabl we have to set up in Shaders. We can achive it by dividing it into three steps:
1) Create effect
2) Get techniques names and variables names
3) Set up these variables’ values with their names
The five step should be the key things tokeep in mind when we need to do rendering.
One more things to notices is:
The object(like a simple sphere) meshes we created by hand is essentially the same thing as modle meshes created by artisets. They record vertices’ position, normal, color and so on. One major different point between them would be molde meshes created by artisets with modle software, like 3DSMax, Maya and so forth, is more complicated than the simple shpere meshes we created, with more informations inside the modle files(like obj, x files).
3D objects key rendering steps的更多相关文章
- #学习笔记# VALSE 2019.01.09 朱俊彦 --- Learning to Synthesize Images, Videos, and 3D Objects
视频类型:VALSE-webinar 报告时间:2019年01月09日 报告人:MIT朱俊彦 报告题目:Learning to Synthesize Images, Videos, and 3D Ob ...
- [ReactVR] Render Custom 3D Objects Using the Model Component in React VR
React VR isn't limited to simple 3D primitives. By using the <Model/> Component we can place a ...
- 从3D Studio Max导入物体 Importing Objects From 3D Studio Max
原地址:http://game.ceeger.com/Manual/HOWTO-ImportObjectMax.html If you make your 3D objects in 3dsMax, ...
- Rendering Transparent 3D Surfaces in WPF with C#(转载)
Rendering Transparent 3D Surfaces in WPF with C# The primary problems that arise when rendering semi ...
- DirectX 11游戏编程学习笔记之6: 第5章The Rendering Pipeline(渲染管线)
本文由哈利_蜘蛛侠原创,转载请注明出处.有问题欢迎联系2024958085@qq.com 注:我给的电子版是700多页,而实体书是800多页,所以我在提到相关概念的时候 ...
- 基于ACIS/HOOPS的3D应用开发简介 【转】
(整理) 平台: 造型引擎——ACIS 显示引擎——Direct3D/OpenGL/GDI 应用框架——HOOPS 组件关系图 ...
- 全球最大的3D数据集公开了!标记好的10800张全景图
Middlebury数据集 http://vision.middlebury.edu/stereo/data/ KITTI数据集简介与使用 https://blog.csdn.net/solomon1 ...
- 3D HTML5 Logo标志 超炫酷旋转特效
今天又要为大家带来一款超酷的HTML5 Canvas 3D动画特效,是一款可以旋转的HTML5 Logo标志.画面上一共有两块可旋转的区域,第一是可旋转的背景,第二则是可旋转的Logo标志.Logo标 ...
- 国外60个专业3D模型网站
原始链接:http://blog.sina.com.cn/s/blog_4ba3c7950100jxkh.html Today, 3D models are used in a wide variet ...
随机推荐
- js一些通用方法的封装
//封装StringBuilder function StringBuilder() { this._string_ = new Array(); } StringBuilder.prototype. ...
- 你需要知道的九大排序算法【Python实现】之堆排序
六.堆排序 堆排序是一种树形选择排序,是对直接选择排序的有效改进. 堆的定义下:具有n个元素的序列 (h1,h2,...,hn),当且仅当满足(hi>=h2i,hi>=2i+1)或(h ...
- Guzzle php resetful webservice farmework
Guzzle is a PHP HTTP client that makes it easy to work with HTTP/1.1 and takes the pain out of consu ...
- POJ 2752 Seek the Name, Seek the Fame(next数组的理解)
做此题,只要理解好next数组就行....................... #include <cstdio> #include <cmath> #include < ...
- Log4Qt使用(三)在DailyRollingFileAppender类中增加属性mMaxBackupIndex
在Log4Qt中存在一个比较大的问题,当使用 DailyRollingFileAppender对日志进行输出时,会无限输出文件,也就是说,当系统运行很久时,日志文件有可能很大,大到无法想象.因此,很多 ...
- somethings about QSplitter
m_splitter = new QSplitter(Qt::Horizontal); m_splitter->addWidget(this->m_leftWidget); m ...
- Json格式的http请求
服务端PHP代码可以从这里下载:https://github.com/lornajane/PHP-Web-Services 1.使用volley实现: request要用JsonObjectReque ...
- easyui-form添加自定义表单验证
easyui自定义表单验证规则其实不是很复杂,只要重写一下重写 $.fn.validatebox.defaults.rules 自定义示例 $.extend($.fn.validatebox.defa ...
- [c#]asp.net开发微信公众平台(2)多层架构框架搭建和入口实现
上篇已经设计出比较完善的数据库了,这篇开始进入代码. 首先把上篇设计的数据库脚本在数据库中执行下,生成数据库,然后在VS中建立项目,为了方便理解和查看,我设计的都是很直白的类名和文件名,没有命名空间 ...
- java优势
跨平台,只要有JVM(Java虚拟机)的操作系统就可以运行JAVA程序: 安全: 弃用危险的指针: 自动内在管理机制,垃圾回收机制,由垃圾回收器回收,减轻程序负担,也避免了手动回收的危险性: 完全面向 ...