正在准备写一个OpenGL的VB.Net程序
2006-11-02 17:26
423 查看
抄袭NEHE的例子,现在还不知道怎么实现,貌似比较复杂!
昨天晚上实现了2D的平面底图和3D物体的综合,感觉不错,就是效果差了一点。
下面这个是主要的Paint代码部分。
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
' 我自己的 OpenGL 代码。
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
PaintGL#Region "PaintGL"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
Public Sub PaintGL()Sub PaintGL()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glClear(Gl.GL_COLOR_BUFFER_BIT + Gl.GL_DEPTH_BUFFER_BIT) ' Clear Screen And Depth Buffer
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
' 绘制背景图。
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glMatrixMode(Gl.GL_PROJECTION)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glPushMatrix()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glLoadIdentity()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glOrtho(0, form.Width, 0, form.Height, -1, 1)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glMatrixMode(Gl.GL_MODELVIEW)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glPushMatrix()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glLoadIdentity()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glDepthMask(Gl.GL_FALSE)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glDisable(Gl.GL_DEPTH_TEST)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glDisable(Gl.GL_LIGHTING)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glEnable(Gl.GL_TEXTURE_2D)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glBindTexture(Gl.GL_TEXTURE_2D, texture(1))
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glColor3ub(255, 255, 255)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glBegin(Gl.GL_QUADS)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glTexCoord2i(0, 0)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex2i(0, 0)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glTexCoord2i(1, 0)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex2i(form.Width, 0)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glTexCoord2i(1, 1)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex2i(form.Width, form.Height)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glTexCoord2i(0, 1)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex2i(0, form.Height)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glEnd()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
'Gl.glDisable(Gl.GL_TEXTURE_2D)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
'Gl.glEnable(Gl.GL_LIGHTING)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glEnable(Gl.GL_DEPTH_TEST)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glDepthMask(Gl.GL_TRUE)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glMatrixMode(Gl.GL_PROJECTION)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glPopMatrix()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glMatrixMode(Gl.GL_MODELVIEW)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glPopMatrix()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glPushMatrix()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
' 绘制矩形/立方体
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glLoadIdentity()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glTranslatef(xOffset, yOffset, zoom)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
' 旋转
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glRotatef(xRot, 1, 0, 0)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glRotatef(yRot, 0, 1, 0)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glRotatef(zRot, 0, 0, 1)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
' 绑定纹理
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glBindTexture(Gl.GL_TEXTURE_2D, texture(0))
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glBegin(Gl.GL_QUADS)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
' 顶面
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
'Gl.glColor3f(0.5, 0.5, 1.0): Gl.glTexCoord2f(0, 0)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glColor3f(1, 1, 1)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(1, 0.5, -0.02) ' : Gl.glTexCoord2f(1, 0)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(-1, 0.5, -0.02) 'Gl.glTexCoord2f(1, 1) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(-1, 0.5, 0.02) 'Gl.glTexCoord2f(0, 1) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(1, 0.5, 0.02) '
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
' 地面
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
'Gl.glColor3f(1.0, 0.5, 0.0) ' : Gl.glTexCoord2f(0, 0)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(1.0, -0.5, 0.02) ' Gl.glTexCoord2f(1, 0) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(-1.0, -0.5, 0.02) ' Gl.glTexCoord2f(1, 1) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(-1.0, -0.5, -0.02) ' Gl.glTexCoord2f(0, 1) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(1.0, -0.5, -0.02)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
' 正面
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glColor3f(1.0, 1.0, 1.0)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glTexCoord2f(1, 1)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(1.0, 0.5, 0.02)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glTexCoord2f(0, 1)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(-1.0, 0.5, 0.02)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glTexCoord2f(0, 0)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(-1.0, -0.5, 0.02)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glTexCoord2f(1, 0)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(1.0, -0.5, 0.02)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
' 后面
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
'Gl.glColor3f(1.0, 1.0, 1.0) ' Gl.glTexCoord2f(0, 0) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(1.0, -0.5, -0.02) ' Gl.glTexCoord2f(1, 0) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(-1.0, -0.5, -0.02) ' Gl.glTexCoord2f(1, 1) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(-1.0, 0.5, -0.02) ' Gl.glTexCoord2f(0, 1) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(1.0, 0.5, -0.02)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
' 左侧面
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
'Gl.glColor3f(0.0, 0.0, 1.0) ' Gl.glTexCoord2f(0, 0) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(-1.0, 0.5, 0.02) ' Gl.glTexCoord2f(1, 0) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(-1.0, 0.5, -0.02) ' Gl.glTexCoord2f(1, 1) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(-1.0, -0.5, -0.02) ' Gl.glTexCoord2f(0, 1) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(-1.0, -0.5, 0.02)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
' 右侧面
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
'Gl.glColor3f(1.0, 0.0, 1) ' Gl.glTexCoord2f(0, 0) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(1.0, 0.5, -0.02) ' Gl.glTexCoord2f(1, 0) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(1.0, 0.5, 0.02) ' Gl.glTexCoord2f(1, 1) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(1.0, -0.5, 0.02) ' Gl.glTexCoord2f(0, 1) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(1.0, -0.5, -0.02)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glEnd()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glPopMatrix()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
rTri += 1.0
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
rQuad -= 0.5
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
End Sub
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
#End Region
昨天晚上实现了2D的平面底图和3D物体的综合,感觉不错,就是效果差了一点。
下面这个是主要的Paint代码部分。
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
' 我自己的 OpenGL 代码。
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
PaintGL#Region "PaintGL"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
Public Sub PaintGL()Sub PaintGL()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glClear(Gl.GL_COLOR_BUFFER_BIT + Gl.GL_DEPTH_BUFFER_BIT) ' Clear Screen And Depth Buffer
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
' 绘制背景图。
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glMatrixMode(Gl.GL_PROJECTION)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glPushMatrix()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glLoadIdentity()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glOrtho(0, form.Width, 0, form.Height, -1, 1)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glMatrixMode(Gl.GL_MODELVIEW)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glPushMatrix()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glLoadIdentity()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glDepthMask(Gl.GL_FALSE)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glDisable(Gl.GL_DEPTH_TEST)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glDisable(Gl.GL_LIGHTING)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glEnable(Gl.GL_TEXTURE_2D)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glBindTexture(Gl.GL_TEXTURE_2D, texture(1))
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glColor3ub(255, 255, 255)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glBegin(Gl.GL_QUADS)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glTexCoord2i(0, 0)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex2i(0, 0)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glTexCoord2i(1, 0)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex2i(form.Width, 0)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glTexCoord2i(1, 1)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex2i(form.Width, form.Height)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glTexCoord2i(0, 1)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex2i(0, form.Height)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glEnd()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
'Gl.glDisable(Gl.GL_TEXTURE_2D)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
'Gl.glEnable(Gl.GL_LIGHTING)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glEnable(Gl.GL_DEPTH_TEST)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glDepthMask(Gl.GL_TRUE)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glMatrixMode(Gl.GL_PROJECTION)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glPopMatrix()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glMatrixMode(Gl.GL_MODELVIEW)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glPopMatrix()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glPushMatrix()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
' 绘制矩形/立方体
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glLoadIdentity()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glTranslatef(xOffset, yOffset, zoom)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
' 旋转
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glRotatef(xRot, 1, 0, 0)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glRotatef(yRot, 0, 1, 0)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glRotatef(zRot, 0, 0, 1)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
' 绑定纹理
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glBindTexture(Gl.GL_TEXTURE_2D, texture(0))
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glBegin(Gl.GL_QUADS)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
' 顶面
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
'Gl.glColor3f(0.5, 0.5, 1.0): Gl.glTexCoord2f(0, 0)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glColor3f(1, 1, 1)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(1, 0.5, -0.02) ' : Gl.glTexCoord2f(1, 0)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(-1, 0.5, -0.02) 'Gl.glTexCoord2f(1, 1) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(-1, 0.5, 0.02) 'Gl.glTexCoord2f(0, 1) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(1, 0.5, 0.02) '
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
' 地面
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
'Gl.glColor3f(1.0, 0.5, 0.0) ' : Gl.glTexCoord2f(0, 0)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(1.0, -0.5, 0.02) ' Gl.glTexCoord2f(1, 0) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(-1.0, -0.5, 0.02) ' Gl.glTexCoord2f(1, 1) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(-1.0, -0.5, -0.02) ' Gl.glTexCoord2f(0, 1) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(1.0, -0.5, -0.02)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
' 正面
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glColor3f(1.0, 1.0, 1.0)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glTexCoord2f(1, 1)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(1.0, 0.5, 0.02)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glTexCoord2f(0, 1)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(-1.0, 0.5, 0.02)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glTexCoord2f(0, 0)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(-1.0, -0.5, 0.02)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glTexCoord2f(1, 0)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(1.0, -0.5, 0.02)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
' 后面
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
'Gl.glColor3f(1.0, 1.0, 1.0) ' Gl.glTexCoord2f(0, 0) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(1.0, -0.5, -0.02) ' Gl.glTexCoord2f(1, 0) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(-1.0, -0.5, -0.02) ' Gl.glTexCoord2f(1, 1) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(-1.0, 0.5, -0.02) ' Gl.glTexCoord2f(0, 1) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(1.0, 0.5, -0.02)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
' 左侧面
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
'Gl.glColor3f(0.0, 0.0, 1.0) ' Gl.glTexCoord2f(0, 0) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(-1.0, 0.5, 0.02) ' Gl.glTexCoord2f(1, 0) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(-1.0, 0.5, -0.02) ' Gl.glTexCoord2f(1, 1) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(-1.0, -0.5, -0.02) ' Gl.glTexCoord2f(0, 1) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(-1.0, -0.5, 0.02)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
' 右侧面
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
'Gl.glColor3f(1.0, 0.0, 1) ' Gl.glTexCoord2f(0, 0) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(1.0, 0.5, -0.02) ' Gl.glTexCoord2f(1, 0) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(1.0, 0.5, 0.02) ' Gl.glTexCoord2f(1, 1) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(1.0, -0.5, 0.02) ' Gl.glTexCoord2f(0, 1) :
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glVertex3f(1.0, -0.5, -0.02)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glEnd()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Gl.glPopMatrix()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
rTri += 1.0
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
rQuad -= 0.5
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
End Sub
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
#End Region
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
相关文章推荐
- 我与VB.net再次重逢,最简单的一个小程序
- 一个简单的VB.net程序
- 一个简单的下载程序VB.NET示例
- VB.Net查找程序的前一个运行结果
- [VB.NET]谁能帮我用验证国内电话号码的正则表达式写一个验证程序啊?
- 防止同一个程序多次运行。 [VB.NET]
- VB.NET制作外接程序的一个示例
- [VB.NET]在VB.NET开发程序时,如何制做一个欢迎界面?
- 一个在VB.net中画圆的程序
- 使用进程互斥实现WinForm程序只运行一个实例(VB.Net)
- 一个自动把Visual Studio.NET的C#,VB.NET,VC++project工程转为NAnt Build的小程序(利用XSL)
- [VB.NET]怎样才能用VB.NET的代码来关闭一个在运行的程序?????
- 一个VB(Net)程序的思考
- 使用进程互斥实现WinForm程序只运行一个实例(VB.Net)
- VB.Net查找程序的前一个运行结果
- 防止同一个程序多次运行。 [VB.NET]
- 准备用VB.Net 写一个律师管理的系统
- C#程序转为VB.NET程序的一个小问题
- [VB.NET]忽然想写一个空间三点定位的程序
- [VB.NET]如何把一个c#程序转变为VB.NET