1 /************************************************** 2 RGBA模式下的反走样直线(抗锯齿)-----红宝书P164------Andy 3 博创论坛http://bochuang.sinaapp.com 4 **************************************************/ 5 6 #include<iostream> 7 #include<GL\freeglut.h> 8 9 using namespace std;10 static float rotAngle = 0.0 Read More
posted @ 2012-05-31 16:05 Andy Sun Views(549) Comments(0) Diggs(0)
//三维透明物体Alpha混合 红宝书P160#include<GL\freeglut.h>#define MAXZ 8.0//Z的最大深度#define MINZ -8.0//Z的最小深度#define ZINC 0.04//Z每次的深度改变值static float solidZ = MAXZ;//实体球的深度static float transparentZ = MINZ;//透明立方体的深度static GLuint sphereList,cubeList;//绘制球和立方体的列表static void init(void){ GLfloat mat_specular[] Read More
posted @ 2012-05-30 19:15 Andy Sun Views(459) Comments(0) Diggs(0)
//红宝书---Alpha分量混合P158#include<GL\freeglut.h>static int leftFirst = GL_TRUE;void init(void){ glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);//设置以【源像素的Alpha*目标像素+(1-源像素的Alpha)*源像素】的混合方式 glShadeModel(GL_FLAT); glClearColor(0.0,0.0,0.0,0.0);}void drawLeftTriangle(void){ glBeg Read More
posted @ 2012-05-29 22:28 Andy Sun Views(514) Comments(0) Diggs(0)
有些时候,由于场景布局的问题,我们不得不将场景在启动时置为全屏。下面就是我使用的方法:在发布场景的时候:1、选择Bulid Setting—>PC And Mac Standlone–>Target Platform–>windows2、设置发布属性,将Display Resolution Dialog设置为Disable即可代码实现:就一条语句:Screen.fullScreen = true;是不是很简单,呵呵。 Read More
posted @ 2012-05-20 10:04 Andy Sun Views(1379) Comments(0) Diggs(0)