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的更多相关文章

  1. #学习笔记# 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 ...

  2. [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 ...

  3. 从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, ...

  4. Rendering Transparent 3D Surfaces in WPF with C#(转载)

    Rendering Transparent 3D Surfaces in WPF with C# The primary problems that arise when rendering semi ...

  5. DirectX 11游戏编程学习笔记之6: 第5章The Rendering Pipeline(渲染管线)

            本文由哈利_蜘蛛侠原创,转载请注明出处.有问题欢迎联系2024958085@qq.com         注:我给的电子版是700多页,而实体书是800多页,所以我在提到相关概念的时候 ...

  6. 基于ACIS/HOOPS的3D应用开发简介 【转】

    (整理) 平台:                造型引擎——ACIS         显示引擎——Direct3D/OpenGL/GDI         应用框架——HOOPS   组件关系图     ...

  7. 全球最大的3D数据集公开了!标记好的10800张全景图

    Middlebury数据集 http://vision.middlebury.edu/stereo/data/ KITTI数据集简介与使用 https://blog.csdn.net/solomon1 ...

  8. 3D HTML5 Logo标志 超炫酷旋转特效

    今天又要为大家带来一款超酷的HTML5 Canvas 3D动画特效,是一款可以旋转的HTML5 Logo标志.画面上一共有两块可旋转的区域,第一是可旋转的背景,第二则是可旋转的Logo标志.Logo标 ...

  9. 国外60个专业3D模型网站

    原始链接:http://blog.sina.com.cn/s/blog_4ba3c7950100jxkh.html Today, 3D models are used in a wide variet ...

随机推荐

  1. [深入React] 3.JSX的神秘面纱

    <div> <List /> </div> 会被编译为: React.createElement("div",null, React.creat ...

  2. 【初学者常见问题】一脚踏入protected埋下的陷阱

    受保护的(protected)——声明该成员的类的子类可以访问这个类的成员(但有一定的限制),并且,声明该成员的包内部的任何类也可以访问这个成员 protected修饰符参考:http://www.3 ...

  3. POJ 2455Secret Milking Machine(二分+网络流之最大流)

    题目地址:POJ2455 手残真浪费时间啊..又拖到了今天才找出了错误..每晚两道题不知不觉又变回了每晚一道题...sad.. 第一次在isap中忘记调用bfs,第二次则是遍历的时候竟然是从1開始遍历 ...

  4. Keil IDE指南.

    Keil IDE指南(转载) 熟悉Keil C 51的朋友对于Keil MDK上手应该比较容易,毕竟界面是很像的.但ARM内核毕竟不同于51内核,因此无论在设置上还是在编程思想上,都需要下番功夫研究的 ...

  5. canvas-画七巧板

    <!doctype html><html lang="en"> <head> <meta charset="UTF-8" ...

  6. 图形绘制 Canvas Paint Path 详解

    图形绘制简介        Android中使用图形处理引擎,2D部分是android SDK内部自己提供,3D部分是用Open GL ES 1.0.大部分2D使用的api都在android.grap ...

  7. box-shadow全面解析

    一.box-shadow语法: box-shadow: none | inset(可选值,不设置,为外投影,设置,为内投影) x-offset(阴影水平偏移量,正方向为right) y-offset( ...

  8. 关于this的指向问题

    一个关于this指向而引发的血案... 在测试this指向的程序中,我写错了id对象,结果呢,居然也有效果,这真是超于我意料之外太多了,我以为自己写错了,结果一样可以用....... <div ...

  9. (转)SQL Server 2005附加2008的数据库

    1. 生成for 2005版本的数据库脚本  2008 的manger studio  -- 打开"对象资源管理器"(没有的话按F8), 连接到你的实例  -- 右键要转到2005 ...

  10. sqlserver获取当前id的前一条数据和后一条数据

    一.条件字段为数值的情况   select * from tb where id=@id; --当前记录   select top 1 * from tb where id>@id order  ...