![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
OpenGl
迪迦 • 奥特曼
C/C++ coder
展开
-
OpenGL透视投影gluPerspective
转自:http://blog.csdn.net/hbuxiaoshe/article/details/5062794void gluPerspective(GLdouble fovy,GLdouble aspect,GLdouble zNear, GLdouble zFar); 其操作是创建一个对称的透视投影矩阵,并且用这个矩阵乘以当前矩阵。 参数fovy定义视野在X-Z平面的角度,范围是[0.转载 2016-10-23 09:18:13 · 482 阅读 · 0 评论 -
RC与DC的介绍与使用
OpenGL的绘图方式与Windows一般的绘图方式是不同的。主要区别如下: 1、Windows采用的是GDI绘图 2、OpenGL采用的是渲染描述表RC绘图。 3、OpenGL使用的是特殊的像素格式。 在Windows中使用GDI绘图时必须指定在哪个设备环境DC中绘制,同同样的在使用OpenGL函数时也必须指定一个所谓的渲染环境。正如DC要存储GDI的绘制环境信息如笔,刷和字体等,RC也转载 2016-11-09 19:25:57 · 4574 阅读 · 0 评论 -
glViewport()函数和glOrtho()函数的理解(转)
在OpenGL中有两个比较重要的投影变换函数,glViewport和glOrtho。 glOrtho是创建一个正交平行的视景体。 一般用于物体不会因为离屏幕的远近而产生大小的变换的情况。比如,常用的工程中的制图等。需要比较精确的显示。 作为它的对立情况, glFrustum则产生一个透视投影。这是一种模拟真是生活中,人们视野观测物体的真实情况。例如:观察两条平行的火车到,在过了转载 2016-11-09 14:08:15 · 309 阅读 · 0 评论 -
纹理坐标
如果使用当前的纹理绘制图元,我们必须在绘制每个顶点之前为该顶点指定纹理坐标。只需调用 glTexCoord2d(s:Double;t:Double);函数即可。其中,s、t是对于2D纹理而言的s、t坐标。对于任何纹理,它的纹理坐标都如同图所示。 对于任何纹理,无论纹理的真正大小如何,其顶端(左上角)的纹理坐标恒为(0,0),右下角的纹理坐标恒为(1,1)。也就是说,纹理坐标应是一转载 2016-11-08 16:21:39 · 591 阅读 · 0 评论 -
Lesson 13 Nehe
#include <gl/opengl.h> #include <stdio.h>HGLRC hRC = NULL; HDC hDC = NULL; HWND hWnd = NULL; HINSTANCE hInstance = NULL;BOOL keys[256]; BOOL active = TRUE; BOOL fullscreen = FALSE;BOOL light = TRUE;原创 2016-11-08 08:53:25 · 483 阅读 · 0 评论 -
Lesson 3 Nehe
#include <gl/opengl.h>HGLRC hRC = NULL; HDC hDC = NULL; HWND hWnd = NULL; HINSTANCE hInstance = NULL;BOOL keys[256]; BOOL active = TRUE; BOOL fullscreen = FALSE;LRESULT CALLBACK WindowProc( HWND hwn原创 2016-10-25 17:44:59 · 278 阅读 · 0 评论 -
Lesson 6 Nehe
#include <gl/opengl.h> #include <stdio.h>HGLRC hRC = NULL; HDC hDC = NULL; HWND hWnd = NULL; HINSTANCE hInstance = NULL;BOOL keys[256]; BOOL active = TRUE; BOOL fullscreen = FALSE;GLfloat xRote; GLf原创 2016-10-25 17:57:30 · 286 阅读 · 0 评论 -
Lesson 5 Nehe
#include <gl/opengl.h>HGLRC hRC = NULL; HDC hDC = NULL; HWND hWnd = NULL; HINSTANCE hInstance = NULL;BOOL keys[256]; BOOL active = TRUE; BOOL fullscreen = FALSE; GLfloat rtri = 0.0f; GLfloat rquad =原创 2016-10-25 17:47:32 · 261 阅读 · 0 评论 -
opengl.h
#ifndef _GM_OPENGL_ #define _GM_OPENGL_ #include <windows.h> // Header File For Windows #include <gl\gl.h> // Header File For The OpenGL32 Library #include <gl\glu.h> // Header原创 2016-10-25 18:05:09 · 363 阅读 · 0 评论 -
Lesson 9 Nehe
#include <gl/opengl.h> #include <stdio.h>HGLRC hRC = NULL; HDC hDC = NULL; HWND hWnd = NULL; HINSTANCE hInstance = NULL;BOOL keys[256]; BOOL active = TRUE; BOOL fullscreen = FALSE;BOOL twinkle = FAL原创 2016-10-25 18:04:22 · 271 阅读 · 0 评论 -
Lesson 8 Nehe
#include <gl/opengl.h> #include <stdio.h>HGLRC hRC = NULL; HDC hDC = NULL; HWND hWnd = NULL; HINSTANCE hInstance = NULL;BOOL keys[256]; BOOL active = TRUE; BOOL fullscreen = FALSE;BOOL light = TRUE;原创 2016-10-25 18:02:46 · 239 阅读 · 0 评论 -
Lesson 7 Nehe
#include <gl/opengl.h> #include <stdio.h>HGLRC hRC = NULL; HDC hDC = NULL; HWND hWnd = NULL; HINSTANCE hInstance = NULL;BOOL keys[256]; BOOL active = TRUE; BOOL fullscreen = FALSE;BOOL light = TRUE;原创 2016-10-25 18:00:56 · 442 阅读 · 0 评论 -
Lesson 12 Nehe
#include <gl/opengl.h> #include <stdio.h>HGLRC hRC = NULL; HDC hDC = NULL; HWND hWnd = NULL; HINSTANCE hInstance = NULL;BOOL keys[256]; BOOL active = TRUE; BOOL fullscreen = FALSE;GLfloat xRote; GLf原创 2016-11-05 15:05:30 · 486 阅读 · 0 评论 -
Lesson 4 Nehe
#include <gl/opengl.h>HGLRC hRC = NULL; HDC hDC = NULL; HWND hWnd = NULL; HINSTANCE hInstance = NULL;BOOL keys[256]; BOOL active = TRUE; BOOL fullscreen = FALSE; GLfloat rtri = 0.0f; GLfloat rquad =原创 2016-10-25 17:46:18 · 234 阅读 · 0 评论 -
Lesson 2 Nehe
#include <gl/opengl.h>HGLRC hRC = NULL; HDC hDC = NULL; HINSTANCE hInstance = NULL; HWND hWnd = NULL; BOOL keys[255]; BOOL active = TRUE; BOOL fullscreen = TRUE; LRESULT CALLBACK原创 2016-10-25 17:43:45 · 245 阅读 · 0 评论 -
Lesson 1 Nehe
#include <gl/opengl.h>HGLRC hRc = NULL; // opengl 着色描述表 HDC hDc = NULL; // Windows 设备描述表 /* opengl 中将着色描述表与设备描述相与联接,设备描述表与GDI相互联接,从而绘图。总体顺序: hRc -> hDc ->原创 2016-10-25 17:42:20 · 270 阅读 · 0 评论 -
Lesson 11 Nehe
#include <gl/opengl.h> #include <stdio.h> #include <math.h>HGLRC hRC = NULL; HDC hDC = NULL; HWND hWnd = NULL; HINSTANCE hInstance = NULL;BOOL keys[256]; BOOL active = TRUE; BOOL fullscreen = FALSE;原创 2016-11-05 11:52:29 · 519 阅读 · 0 评论 -
glBlendFunc() opengl 混合
一、混合是什么呢? 混合就是把两种颜色混在一起。具体一点,就是把某一像素位置原来的颜色和将要画上去的颜色,通过某种方式混在一起,从而实现特殊的效果。假设我们需要绘制这样一个场景:透过红色的玻璃去看绿色的物体,那么可以先绘制绿色的物体,再绘制红色玻璃。在绘制红色玻璃的时候,利用“混合”功能,把将要绘制上去的红色和原来的绿色进行混合,于是得到一种新的颜色,看上去就好像玻璃是半透明的。要使用OpenGL转载 2016-10-24 15:58:09 · 262 阅读 · 0 评论 -
Lesson 18 Nehe
#include <gl/opengl.h> #include <stdio.h>HGLRC hRC = NULL; HDC hDC = NULL; HWND hWnd = NULL; HINSTANCE hInstance = NULL;BOOL keys[256]; BOOL active = TRUE; BOOL fullscreen = FALSE;BOOL light = TRUE;原创 2016-11-10 20:13:33 · 419 阅读 · 0 评论