首页 > TAG信息列表 > glColor3f

OPENGL实验二

//#include "stdafx.h" #include<gl/glut.h> #include<math.h> #include <stdlib.h> const double PI = 3.14159265357f; void myDisplay(void) { glClearColor(0.0, 0.0, 0.0, 0.0); glClear(GL_COLOR_BUFFER_BIT); //红色菱形 glBegin(GL

图形变换——变速移动

#include <GL/glut.h> #include <iostream> using namespace std; #include <stdlib.h> GLfloat rtri = 0.0; //金字塔旋转角度 GLfloat speed = 0.0; GLfloat WYDistance = -5.0; GLfloat level = -1.0; void init(void) { glClearColor(0.0f, 0.0f, 0.0f

OpenGL 彩色旋转立方体

原文链接:http://www.cnblogs.com/wangshide/archive/2012/04/30/2477131.html   /* * * 彩色旋转立方体 * 1. 定义六个面,同时定义每个顶点的颜色(与顶点坐标相对应) * 2. 启用 GL_SMOOTH 方式渲染 * * */ #include <stdio.h> #include<GL\glut.h> s

OpenGL实例:几何变换

OpenGL实例:几何变换 作者:凯鲁嘎吉 - 博客园 http://www.cnblogs.com/kailugaji/ 更多请查看:计算机图形学 1. 平移 #include <GL/glut.h>void init(void){ glClearColor(1.0, 1.0, 1.0, 0.0); //指定清除颜色 //初始化视景体 glMatrixMode(GL_PROJECTION); gluOrtho2D(-5.0, 5.0