随笔分类 - OpenGL
摘要: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
阅读全文
摘要://三维透明物体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[]
阅读全文
摘要://红宝书---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
阅读全文

浙公网安备 33010602011771号