自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(11)
  • 收藏
  • 关注

原创 cocos2d-之sprite类解析

/** *精灵是一个2d图像 * *精灵可以通过一张图片或者图片的某个矩形区域来创建 * *为了优化图片,请遵循以下原则: *-将所有精灵放在同一个spritesheet(精灵表单) *-所有精灵里用同一个blending function(混合函数) *-Renderer(渲染器)将会自动批处理精灵(会绘制在同一个OpenGL call里面) * *为了获得5%-10%的渲染

2016-05-27 16:47:23 386

原创 希尔排序

#include /** 希尔排序 -- 取n/2作为第一个增量,把数组全部元素分为n/2个组,相距n/2的倍数的元素 分为一组,在各组内进行直接插入排序;取n/2/2作为第二个增量,重复上述分组过程。 **/ int main() { int arr[10] = {10,9,8,7,6,5,4,3,2,1}; void ShellSort( int array[], int n );

2016-05-06 14:01:25 244

原创 折半插入排序

#include /** 折半插入 -- 将数组分为有序区和无序区,将无序区第一个元素采用折半查找方法在有序区找到插入 位置,再通过移动元素进行插入。 **/ int main() { int arr[5] = {5,4,3,2,1}; void InsertSort2( int array[], int n ); InsertSort2(arr,5); for( int i = 0

2016-05-06 11:13:24 243

原创 直接插入排序

#include /** 直接插入排序 -- 数组arr被分为有序区和无序区,刚开始时,有序区只有arr[0]一个元素。 每趟排序将无序区第一个元素插入到有序区适当位置中。 **/ int main() { int arr[5] = {5,4,3,2,1}; void InsertSort( int array[], int n ); InsertSort(arr,5); for(

2016-05-06 10:44:37 197

原创 直接选择排序

#include /** 直接选择排序 -- 将数组分为有序区和无序区,每一趟在无序区取出一个最小的数放入有序区,使有序 区增加一个元素,经过n-1趟排序之后,整个数组递增有序。 **/ int main() { int arr[5] = {5,4,3,2,1}; void SelectSort( int array[], int n ); SelectSort(arr,5); fo

2016-05-04 22:55:06 167

原创 归并排序

#include /** 归并排序 -- 将两个有序表直接归并为一个有序表的算法称为归并排序,设两个有序表存放在同一 数组相邻位置:R[left..mid]和R[mid+1..right]。从两个表第一元素开始,每次从两个表取出一 个元素进行比较,将较小者放入临时数组R1中,直到其中一个表的元素全部放入R1为止,将另一个 表余下的元素赋值到R1,这样R1是一个有序表,再将其复制回R中。 **/

2016-05-04 10:01:39 140

原创 快速排序

#include /** 快速排序 **/ void swap( int &a, int &b ); void qSort( int array[], int left, int right ); int main() { int array[] = {10,5,20,25}; qSort(array,0,3); for( int i=0; i std:

2016-04-28 19:36:35 202

原创 git和cocos2dx基本配置

1.1git 基本配置 1.2配置ssh                                         1.3add sshKey 1.4检测是否成功 1.5Clone       1.6下载项目hosts到目录   1.7尝试add commit push操作     2.1 coco

2016-04-18 19:37:22 469

转载 Lesson 3: Hidden faces removal (z buffer)

1. { // just dumping the 2d scene (yay we have enough dimensions!) TGAImage scene(width, height, TGAImage::RGB); // scene "2d mesh" line(Vec2i(20, 34), Vec2i(744, 400

2016-03-18 16:36:11 301 1

转载 Lesson 2: Triangle rasterization and back face culling

1.实现画三角形 void triangle(Vec2i t0, Vec2i t1, Vec2i t2, TGAImage &image, TGAColor color) { line(t0, t1, image, color); line(t1, t2, image, color); line(t2, t0, image, color); } // ...

2016-03-17 18:16:12 296

转载 Lesson 1: Bresenham’s Line Drawing Algorithm

1. void line(int x0, int y0, int x1, int y1, TGAImage &image, TGAColor color) { for (float t=0.; t1.; t+=.01) { int x = x0*(1.-t) + x1*t; int y = y0*(1.-t) + y1*t; ima

2016-03-16 16:55:12 689

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除