题目地址
题目描述
给定一棵二叉树,返回其节点值的后序遍历。
你想开发游戏还是改变世界?
上一篇文章中,我们使用了 Assimp 导入了一个模型,然后将其的顶点和索引全部提取出来并成功在屏幕上渲染。但是这样做有个很明显的问题,我们没法贴图。因为大部分模型的贴图都是针对单个 Mesh 来创建的,我们将所有顶点提出来一起渲染,自然是没有办法做这个了,所以最后我们得到的是一个纯色的蜘蛛。
而这一篇中我们将针对 Mesh 进行渲染,并且对其贴图。
We stack glasses in a pyramid, where the first row has 1 glass, the second row has 2 glasses, and so on until the 100th row. Each glass holds one cup (250ml) of champagne.
Then, some champagne is poured in the first glass at the top. When the top most glass is full, any excess liquid poured will fall equally to the glass immediately to the left and right of it. When those glasses become full, any excess champagne will fall equally to the left and right of those glasses, and so on. (A glass at the bottom row has it’s excess champagne fall on the floor.)
这篇文章中,我们将使用 Assimp 库导入一个 3D 模型。
在以往的代码中,我们使用硬编码来定义顶点坐标,可以很简单的输出一些顶点较少的模型,但是当某个模型比较复杂的时候,这样做就显得不太现实了。所以一般情况下我们是在 3D 建模工具下建模,然后导出为模型文件,通过代码导入。这篇文章便来介绍 Assimp 在 DX 下的使用。