Chinaunix首页 | 论坛 | 博客
  • 博客访问: 8348296
  • 博文数量: 1413
  • 博客积分: 11128
  • 博客等级: 上将
  • 技术积分: 14685
  • 用 户 组: 普通用户
  • 注册时间: 2006-03-13 10:03
个人简介

follow my heart...

文章分类

全部博文(1413)

文章存档

2013年(1)

2012年(5)

2011年(45)

2010年(176)

2009年(148)

2008年(190)

2007年(293)

2006年(555)

分类:

2006-11-26 19:43:12

Option Explicit
'引擎
Private TV8 As TVEngine
'模型
Private Teapot As TVMesh
'显示模型的场景
Private Scene As TVScene

Private DoLoop As Boolean

Private Sub cmdQuit_Click()

    DoLoop = False

End Sub

Private Sub Form_Load()

    Set TV8 = New TVEngine

    TV8.Init3DWindowedMode Picture1.hWnd

    TV8.DisplayFPS = True
 '定义场景
    Set Scene = New TVScene
 '定义模型
    Set Teapot = New TVMesh
 '告诉场景,要在场景中建立模型了
    Set Teapot = Scene.CreateMeshBuilder
 '建立了一个茶壶模型
    Teapot.CreateTeapot
 '设置位置
    Teapot.SetPosition 0, 0, 10

    Form1.Show

    DoLoop = True
    Main_Loop

End Sub

Private Sub Form_Unload(Cancel As Integer)

    DoLoop = False

    Main_Quit

End Sub

Private Sub Main_Loop()

    
    Do

        DoEvents

        TV8.Clear

        Scene.RenderAllMeshes

        TV8.RenderToScreen

    Loop Until DoLoop = False

    Main_Quit

End Sub

Private Sub Main_Quit()

    Set Teapot = Nothing

    Set Scene = Nothing

    Set TV8 = Nothing

    End

End Sub

阅读(2784) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~