杨帆博客

你想开发游戏还是改变世界?


  • 首页

  • 标签

  • 归档

  • 搜索

二叉树后序遍历(非递归)

发表于 2018-03-29 | 更新于: 2018-08-22

题目地址

LeetCode#145 二叉树后序遍历-非递归

题目描述

  给定一棵二叉树,返回其节点值的后序遍历。

阅读全文 »

【DirectX】14-使用Mesh为单元绘制

发表于 2018-03-28 | 更新于: 2018-08-22

  上一篇文章中,我们使用了 Assimp 导入了一个模型,然后将其的顶点和索引全部提取出来并成功在屏幕上渲染。但是这样做有个很明显的问题,我们没法贴图。因为大部分模型的贴图都是针对单个 Mesh 来创建的,我们将所有顶点提出来一起渲染,自然是没有办法做这个了,所以最后我们得到的是一个纯色的蜘蛛。

  而这一篇中我们将针对 Mesh 进行渲染,并且对其贴图。

阅读全文 »

Champagne-Tower

发表于 2018-03-28 | 更新于: 2018-08-22

题目地址

LeetCode#799 Champagne Tower

题目描述

  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.)

阅读全文 »

第N个数字(中国区试试水)

发表于 2018-03-27 | 更新于: 2018-08-22

  今天中午提交申请转移到中国区,今天下午就发邮件提示成功了,来试试水。不过感觉有点坑啊,后悔了。。。

题目地址

LeetCode#400 第N个数字

题目描述

  在无限的整数序列 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, …中找到第 n 个数字。

阅读全文 »

【DirectX】13-Assimp库

发表于 2018-03-27 | 更新于: 2018-08-22

  这篇文章中,我们将使用 Assimp 库导入一个 3D 模型。

  在以往的代码中,我们使用硬编码来定义顶点坐标,可以很简单的输出一些顶点较少的模型,但是当某个模型比较复杂的时候,这样做就显得不太现实了。所以一般情况下我们是在 3D 建模工具下建模,然后导出为模型文件,通过代码导入。这篇文章便来介绍 Assimp 在 DX 下的使用。

阅读全文 »
1…171819…46
KsGin

KsGin

游戏程序员/计算机图形学/Unity/西山居搬砖

226 日志
16 标签
GitHub E-Mail Google Twitter
© 2018 KsGin @ 2018
0%