二、 代码及分析
#include
using namespace std;
const int MaxSize=20;
template
class Mgraph
{
public:
Mgraph(T a[],int n,int e);
private:
T vertex[MaxSize];
int arc[MaxSize][MaxSize];
int ver...
分类:
其他好文 时间:
2015-01-12 09:21:41
阅读次数:
201
最后几章大致看了例子,1.卡通着色:主要是运用 “灰度纹理”,依据light和面片normal的点积,对应灰度纹理的纹理坐标2.轮廓勾勒:主要运用vertex的扩充和每个vertex的normal进行vertex的延伸,记住同坐标点的vertex可能重复出现多次 比如现在面片三角ABC三个点,每条边...
分类:
其他好文 时间:
2015-01-11 18:57:03
阅读次数:
325
写在前面自己写过Vertex & Fragment Shader的童鞋,大概都会对Unity的光照痛恨不已。当然,我相信这是因为我们写得少。。。不过这也是由于官方文档对这方面介绍很少的缘故,导致我们无法自如地处理很多常见的光照变量。这篇我们就来讨论下Unity内置的一些光照变量和函数到底怎么用。以下内容均建立在Forward Rendering Path的基础上。Forward Rendering...
分类:
编程语言 时间:
2015-01-07 23:35:07
阅读次数:
540
工程下载地址:http://pan.baidu.com/s/1ntr7NHv提取码:yf1h一、本文牵扯知识点梳理:(1)VBO(2)纹理(3)libpng(加载png)(4)shader1、VBO(Vertex Buffer Objec)//顶点坐标 glEnableVertexAttribArr...
分类:
其他好文 时间:
2015-01-07 00:34:17
阅读次数:
528
着色器(Shader)顶点着色器(Vertex shader)片段着色器(Fragment shader)几何着色器(Geometry Shader)提供通用计算能力的着色器(Compute Shader)顶点着色器(Vertex Shader)每个顶点都要执行一次Vertex Shader。 它的...
分类:
其他好文 时间:
2015-01-06 20:01:51
阅读次数:
188
D3D11 WARNING #356这个傻warning的意思看起来是说vertex buffer 太小了描述是这样的: Vertex Buffer at the input vertex slot 0 is not big enough for what the Draw*() call expe...
分类:
其他好文 时间:
2015-01-06 11:36:00
阅读次数:
481
地形笔记:实现过程关键点:1.高度图的读取(得到Y值)-->创建平面网格(得到x z值)-->生成vertex和index 2.纹理映射和预设light:创建空texture-->映射vertex对应的纹理坐标-->映射不同height对应的color-->根据lightDirection计算单位网...
分类:
其他好文 时间:
2015-01-04 17:00:53
阅读次数:
105
public class Graph{ public void dfs(Vertex u) { u.visit(); u.visited = true; for(each v such that (u,v) belongs E) { if(!v.visited)...
分类:
其他好文 时间:
2014-12-28 10:21:32
阅读次数:
171
使用之前需要先导入:from graph_tool.all import *1、 创建一个图有向图:g = Graph()无向图:ug = Graph(directed=False)或ug = Graph()ug.set_directed(False)2、 创建节点:v1 =g.add_vertex...
分类:
编程语言 时间:
2014-12-27 22:53:09
阅读次数:
561
# include
# define MAX_VERTEX_NUM 20
# define INFINITY 32768
# define Error -1
# define OK 1
typedef int AdjType;
typedef enum{DG,DN, UDG,UDN} GraphKind;
typedef char VertexData;
struct
{
...
分类:
其他好文 时间:
2014-12-17 16:33:51
阅读次数:
214