图像学实验 旋转茶壶
环境
Windows10
Visual Studio 2017
配置32和64位OpenGL环境。
配置方法和工程文件:点击下载配置文件
实验代码
// 实验三 旋转茶壶.cpp: 定义控制台应用程序的入口点。
//
#include"stdafx.h"
#define GLUT_DISABLE_ATEXIT_HACK
#pragma comment(lib, "glut32.lib")
#include <windows.h>
#include <gl/gl.h>
#include <GL/glut.h>
#include<iostream>
#include <stdlib.h>
using namespace std;
GLfloat roate = 0.0;// set rote of roate ying yu bu hao bu zhuang le 设置旋转速率
GLfloat rote = 0.0;//shezhi旋转角度
GLfloat anglex = 0.0;//X 轴旋转
GLfloat angley = 0.0;//Y 轴旋转
GLfloat anglez = 0.0;//Z 轴旋转
GLint WinW = 400;
GLint WinH = 400;
GLfloat oldx;//当左键按下时记录鼠标坐标
GLfloat oldy;
void init(void)
{
glClearColor(1.0, 1.0, 1.0, 1.0); //背景黑色
}
void display(void)
{
glClear(GL_COLOR_BU