文件名称:MyWater
介绍说明--下载内容均来自于网络,请自行研究使用
基于vc++使用opengl开发的3D水纹波浪,
场景绘制与渲染
BOOL CMyWaterView::RenderScene()
{
glClear(GL_COLOR_BUFFER_BIT)
glPushMatrix()
glScalef(10,1,10)
if (!rgb)
glColor3f(.31, .41, .97)
else
glColor3f(1.f,1.f,1.f)
glTranslatef(0.f,-1.f,0.f)
glMatrixMode(GL_TEXTURE)
glPushMatrix()
glTranslatef(ttrans[0], ttrans[1], 0.)
glScalef(10.f, 10.f,1.f)
draw_mesh()
glPopMatrix()
glMatrixMode(GL_MODELVIEW)
glPopMatrix()
ttrans[0] += .005f
if (ttrans[0] == 1.0f) ttrans[0] = 0.0f
ttrans[1] -= .0025f
if (ttrans[1] <= 0.0f) ttrans[1] = 1.0f
::SwapBuffers(m_pDC->GetSafeHdc()) //交互缓冲区
return TRUE
}-Based on vc++ using the opengl developed 3D wave水纹, drawing and rendering scenes BOOL CMyWaterView:: RenderScene () (glClear (GL_COLOR_BUFFER_BIT) glPushMatrix () glScalef (10,1,10) if (! Rgb) glColor3f ( .31, .41, .97) else glColor3f (1.f, 1.f, 1.f) glTranslatef (0.f,-1.f, 0.f) glMatrixMode (GL_TEXTURE) glPushMatrix () glTranslatef (ttrans [0], ttrans [1], 0.) glScalef (10.f, 10.f, 1.f) draw_mesh () glPopMatrix () glMatrixMode (GL_MODELVIEW) glPopMatrix () ttrans [0]+ = .005 f if (ttrans [0] == 1.0f) ttrans [0] = 0.0f ttrans [1]-= .0025 f if (ttrans [1] < = 0.0f) ttrans [1 ] = 1.0f :: SwapBuffers (m_pDC-> GetSafeHdc ()) // interactive buffer return TRUE )
场景绘制与渲染
BOOL CMyWaterView::RenderScene()
{
glClear(GL_COLOR_BUFFER_BIT)
glPushMatrix()
glScalef(10,1,10)
if (!rgb)
glColor3f(.31, .41, .97)
else
glColor3f(1.f,1.f,1.f)
glTranslatef(0.f,-1.f,0.f)
glMatrixMode(GL_TEXTURE)
glPushMatrix()
glTranslatef(ttrans[0], ttrans[1], 0.)
glScalef(10.f, 10.f,1.f)
draw_mesh()
glPopMatrix()
glMatrixMode(GL_MODELVIEW)
glPopMatrix()
ttrans[0] += .005f
if (ttrans[0] == 1.0f) ttrans[0] = 0.0f
ttrans[1] -= .0025f
if (ttrans[1] <= 0.0f) ttrans[1] = 1.0f
::SwapBuffers(m_pDC->GetSafeHdc()) //交互缓冲区
return TRUE
}-Based on vc++ using the opengl developed 3D wave水纹, drawing and rendering scenes BOOL CMyWaterView:: RenderScene () (glClear (GL_COLOR_BUFFER_BIT) glPushMatrix () glScalef (10,1,10) if (! Rgb) glColor3f ( .31, .41, .97) else glColor3f (1.f, 1.f, 1.f) glTranslatef (0.f,-1.f, 0.f) glMatrixMode (GL_TEXTURE) glPushMatrix () glTranslatef (ttrans [0], ttrans [1], 0.) glScalef (10.f, 10.f, 1.f) draw_mesh () glPopMatrix () glMatrixMode (GL_MODELVIEW) glPopMatrix () ttrans [0]+ = .005 f if (ttrans [0] == 1.0f) ttrans [0] = 0.0f ttrans [1]-= .0025 f if (ttrans [1] < = 0.0f) ttrans [1 ] = 1.0f :: SwapBuffers (m_pDC-> GetSafeHdc ()) // interactive buffer return TRUE )
(系统自动生成,下载前可以参看下载内容)
下载文件列表
MyWater
.......\Debug
.......\.....\MainFrm.obj
.......\.....\MyTexture.obj
.......\.....\MyWater.exe
.......\.....\MyWater.ilk
.......\.....\MyWater.obj
.......\.....\MyWater.pch
.......\.....\MyWater.pdb
.......\.....\MyWater.res
.......\.....\MyWaterDoc.obj
.......\.....\MyWaterView.obj
.......\.....\StdAfx.obj
.......\.....\vc60.idb
.......\.....\vc60.pdb
.......\.....\WATER1.BW
.......\MainFrm.cpp
.......\MainFrm.h
.......\MyTexture.cpp
.......\MyTexture.h
.......\MyWater.clw
.......\MyWater.cpp
.......\MyWater.dsp
.......\MyWater.dsw
.......\MyWater.h
.......\MyWater.ncb
.......\MyWater.opt
.......\MyWater.plg
.......\MyWater.rc
.......\MyWaterDoc.cpp
.......\MyWaterDoc.h
.......\MyWaterView.cpp
.......\MyWaterView.h
.......\ReadMe.txt
.......\RES
.......\...\MyWater.rc2
.......\Resource.h
.......\StdAfx.cpp
.......\StdAfx.h
.......\WATER1.BW
.......\Debug
.......\.....\MainFrm.obj
.......\.....\MyTexture.obj
.......\.....\MyWater.exe
.......\.....\MyWater.ilk
.......\.....\MyWater.obj
.......\.....\MyWater.pch
.......\.....\MyWater.pdb
.......\.....\MyWater.res
.......\.....\MyWaterDoc.obj
.......\.....\MyWaterView.obj
.......\.....\StdAfx.obj
.......\.....\vc60.idb
.......\.....\vc60.pdb
.......\.....\WATER1.BW
.......\MainFrm.cpp
.......\MainFrm.h
.......\MyTexture.cpp
.......\MyTexture.h
.......\MyWater.clw
.......\MyWater.cpp
.......\MyWater.dsp
.......\MyWater.dsw
.......\MyWater.h
.......\MyWater.ncb
.......\MyWater.opt
.......\MyWater.plg
.......\MyWater.rc
.......\MyWaterDoc.cpp
.......\MyWaterDoc.h
.......\MyWaterView.cpp
.......\MyWaterView.h
.......\ReadMe.txt
.......\RES
.......\...\MyWater.rc2
.......\Resource.h
.......\StdAfx.cpp
.......\StdAfx.h
.......\WATER1.BW