- 博客(24)
- 收藏
- 关注
原创 web前端 跨域问题
最近在做web开发,遇上跨域问题。XMLHttpRequest cannot load http://*******************,NO 'Access-Control-Allow-Origin' header is present on the requested resource .解决办法:进入/etc/httpd/conf/httpd.conf
2015-12-23 14:17:32
533
原创 关于单链表
#include #include using namespace std;//int Er_fen(int A[],int length,int data)//{// int begin=0;// int end=length-1;// while (begin<=end)// {// int midle=(begin+end)/2;// if (data==A[mid
2014-09-15 21:15:32
370
原创 自己练手的
#include #include #include #include #include #include using namespace std; map sum;map::iterator it;void quick_sort(int s[], int l, int r) { if (l < r) { //Swap(s[l], s[(l + r
2014-09-12 10:50:58
403
原创 约瑟夫环及单链表
#include class Linklist{public: //建立带头结点的空链表 Linklist() { head=new LinkNode; head->next=head; } //复制构造函数 /*Linklist(Linklist &L) { head=new LinkNode; LinkNode* p=L.head->next; Li
2014-04-15 13:26:15
555
原创 C++ 线性表
#includeclass List{public: List(int size) { elem=new int[size]; if(!elem){ std::cout<<"内存溢出!"; } cap=size; l=0; } ~List() { } void creat_list(); void check_list(List L) {
2014-04-08 21:08:24
423
原创 小杂程序(给自己看的)
#include#include #include "FreeImage.h"float angle=0.0;float angle1=0.0;float r=0.0;float xrot;float yrot;float zrot;int wiggle_count=0;float hold;const char BACKWARD_STATE=1;const char
2013-11-27 18:17:11
497
原创 openGL
#includefloat angle=0.0;float angle1=0.0;void init(void){ /*float mat_specular[]={1.0,1.0,1.0,1.0}; float mat_shininess[]={50.0}; float light_position[]={10.0,10.0,10.0,0.0}; float white_li
2013-11-22 17:04:26
557
原创 最大公约数,最小公倍数
#include using namespace std;int GetCommon(int a,int b){ int m,n; if(a>b) { m=a; n=b; } else { m=b; n=a; } int j; while(m%n) //利用辗转相除法求出最大公约数 { j=m; m=
2013-10-29 10:07:53
414
原创 十进制转八进制
#include using namespace std;const int stack_size=30;const int stack_increase=10;typedef struct { int* base; int *top; int length;}SqStack; SqStack InitStack(SqStack &S){ S.base =(int *)m
2013-09-24 22:49:52
466
原创 梦中梦
梦中总是有个声音在问我:“你怎么不去那个岛上去寻找他?”清脆可爱的声音,带着天真和无邪,却看不清她的脸。我要找谁,找谁呢? 不知道也莫名其妙,我们一群人上了一艘帆船,一路颠沛流离,穿过层层的迷雾,途中很多人不知道死去。 终于到了一个岛,很美的一个热带岛,绿树葱郁,还有很多很美的果子挂坠在树上,晶莹剔透,我却感到惶恐,一个酋长模样的人热情的接待了我们,让我们随他去他们的族人那边,我们这些
2013-09-23 21:45:52
504
原创 栈的一些基本操作
#include #include using namespace std;const int stack_size=30;const int stack_increase= 10;typedef struct { int* base; int length; int* top;}SqStack;SqStack Create_stack(SqStack &S){ S
2013-09-23 20:17:23
529
原创 FreeImage+openGL
最近一直重拾自己以前做的东西,心中有个想法,想实现。当载入图片的时候用的是FreeImage,FreeImage是比较好用的库,不说了 以下见源代码。“Texture.h”和“Texture.cpp”是FreeImage库中自带的程序,main函数是结合了openGL写的。TextureManager.h//***************************************
2013-09-20 03:08:43
1278
原创 三维向量的标准化,两点距离,点乘,叉乘
#include using namespace std;struct vector{ float x; float y; float z;}; vector c; float Get_Length(vector &a) { return a.x*a.x+a.y*a.y+a.z*a.z; } float Distance(vector &a,vector &b)
2013-09-18 16:46:11
2640
原创 堆排序
#include #include #includeusing namespace std;void Max_Heapkey(int a[],int i,int length){ int largest=i; int left =2*i;//i的左结点序列号 int right =2*i+1;//i的右结点序列号 if(i<=length/2) { if (lef
2013-09-14 15:19:56
421
原创 快速排序
#include using namespace std;int AdjustArray(int a[],int l,int s){ int i=l,j=s; int x=a[l];//设定一个参考值; while (i<j) { while (i=x)//从后面开始,如果i<j并且后面的数大于参考值 j--; //j向前进一个数 if(i<j) {
2013-09-13 17:26:48
411
原创 关于openGL纹理贴图的一些函数
glTexCoord();纹理坐标;glGenTextures();分配一个纹理;glBindTexture();绑定一个纹理;glTexImage2D();2D纹理内容;glTexParameter();纹理过滤;glTexEnv();纹理环境参数设置;纹理贴图的目标有:GL_TEXTURE_1D,GL_TEXTURE_2D,GL_TEXTURE_3D,GL_TEXTUR
2013-02-25 18:34:05
540
原创 光照
最近没怎么写程序 今天看了光照这个部分写了个光照旋转的正方体。以下是源代码:#include const GLfloat redLightColor[]={1.0,0.0,0.0,1.0};const GLfloat redLightPos[]={2.0,2.0,10.0,1.0};const GLfloat greenLightColor[]={0.1,0.6,0.2,1.0};c
2012-11-29 17:04:43
340
原创 模块对于 SAFESEH 映像是不安全的 错误解决
VS2012运行时出现模块对于 SAFESEH 映像是不安全的解决方法:打开属性->链接器->命令行->其他选项:/SAFESEH:NO搞定。
2012-11-22 19:16:50
2749
原创 opengl 蝴蝶飞
本人一直在学习opengl, 技术仍然有很大的发展空间 以下程序是蕴酿很长时间才写出来的,可能在有些高手大牛面前时小case 但是我用了大约一个星期做出来 这些博客记录了我一步步学习opengl的过程 希望有些代码能给其他新手一些idea。本程序读取图片用了freeimage库,这样可以读很多不同种的格式图片,真的很好用,所以大家在运行一下程序的时候要配置一下属性。另外我在蝴蝶后面加了一些花的
2012-11-22 14:06:08
1183
原创 Assimp与Freeimage的结合
最近在做一个加载场景模型的模块,新手,以下源代码基本都是assimp中的示例源码,只是将原来的Devil加载图片库,变成Freeimage库,仅供参考。(freeimage在LoadImage中)#include #include #include #include #include //to map image filenames to textureIds#
2012-11-17 10:10:01
1884
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人