以下面的图片为例题,仅给出源代码,不谈算法思想。
#include
#include
#include
#define MAX_VERTEX_NUM 20+3 //最大顶点数量
//#define true 1
//#define false 0
using namespace std;
typedef char VERTEX_TYPE; //顶点的类型
typedef struc...
分类:
其他好文 时间:
2014-10-05 12:07:48
阅读次数:
215
理论:深度优先搜索(Depth_Fisrst Search)遍历类似于树的先根遍历,是树的先根遍历的推广:广度优先搜索(Breadth_First Search) 遍历类似于树的按层次遍历的过程:java实现Vertex.javapackage 图;public class Vertex{ S...
分类:
其他好文 时间:
2014-10-04 21:27:27
阅读次数:
432
光照
1. 首先需要定义这样的顶点结构
struct CUSTOMVERTEX
{
D3DXVECTOR3position; // 顶点
D3DXVECTOR3normal; // 法向量
};
// Custom flexible vertex format (FVF).
#define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZ...
分类:
其他好文 时间:
2014-09-29 19:13:41
阅读次数:
179
用十字链表结构写的,根据数据结构书上的描述和自己的理解实现。但理解的不透彻,所以不知道有没有错误。但实验了几个都ok.#include #include using namespace std;//有向图十字链表表示#define MAX_VERTEX_NUM 20typedef struct Ar...
分类:
其他好文 时间:
2014-09-25 17:40:59
阅读次数:
188
之前一直搞不懂为何IASetVertexBuffers可以设置多个vertex buffer,而IASetIndexBuffer只能设置一个index buffer,这怎么能够对应得上呢? 这两天要做一个东西,要从一个3ds文件中读出多个对象渲染出来,我以为这就可以将每个对象的顶点存到一个...
分类:
其他好文 时间:
2014-09-25 16:29:59
阅读次数:
213
题目链接In a rooted tree, thelowest common ancestor(or LCA for short) of two verticesuandvis defined as the lowest vertex that is ancestor of both that tw...
分类:
其他好文 时间:
2014-09-24 22:50:17
阅读次数:
296
前文完成了最基本的镜面反射着色器,单平行光源下的逐顶点着色(per-vertex lighting),又称为古罗着色(Gouraud shading)。这篇文章作为后续讨论更光滑的镜面反射方式,逐像素着色(per-pixcel lighting),又称为冯氏着色(Phong shading)
逐像素着色Per-Pixel Lighting (冯氏着色Phong Shading)
别把冯氏着色与冯氏反射模型搞混淆了,前问提到了冯氏反射模型,冯氏反射模型是为使计算机模拟接近真实的物体表面光泽提出的模型,即环境...
分类:
其他好文 时间:
2014-09-24 19:07:57
阅读次数:
234
Given a graph G(V, E), a clique is a sub-graph g(v, e), so that for all vertex pairs v1, v2 in v, there exists an edge (v1, v2) in e. Maximum clique is the clique that has maximum number of
vertex.
...
分类:
其他好文 时间:
2014-09-11 08:47:58
阅读次数:
260
GLSL 的产生,可以为了更灵活的3D图像编程
APP和GPU的关系图
GLSL 包括 Vertex programs 和 Fragment pgrograms, 实际是对 Geometry 和 Rasterization 的输出
管线处理如下,以前管线不能编程,现在GLSL让管线更灵活了。
Shader 的知...
分类:
其他好文 时间:
2014-09-05 18:22:11
阅读次数:
276
坐标系与基本图元(6)灵活顶点格式灵活顶点格式(Flexible Vertex Format, FVF)用来描述在顶点缓冲区中的顶点存储格式中包含了哪些属性。Direct3D应用程序可以用几种不同的方式定义灵活顶点格式。灵活顶点格式使应用程序只使用它需要的顶点数据,排除那些它不需要的组成成分。这样,...
分类:
其他好文 时间:
2014-09-01 12:30:33
阅读次数:
257