Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 2.35 KB | None | 0 0
  1. Imports TV3D65
  2.  
  3. Public Class Form1
  4.     Public _engine As TVEngine
  5.     Public inp As TVInputEngine
  6.     Public numofmeshes As Integer = -1
  7.     Public _scenemeshes() As TVMesh
  8.     Public _scene As TVScene
  9.     Public bdoloop As Boolean
  10.     Public mesharry As ArrayList
  11.     Private Function DataFile() As String
  12.         Dim file_name As String = Application.StartupPath
  13.         file_name &= "\scene\sconf.txt"
  14.         Return file_name
  15.     End Function
  16.  
  17.     Public Sub Getrmesh()
  18.         Try
  19.             Dim file_name As String = DataFile()
  20.             Dim stream_reader As New IO.StreamReader(file_name)
  21.             Dim line As String
  22.             line = stream_reader.ReadLine()
  23.             Do Until line = "END"
  24.  
  25.                 line = line.Trim$()
  26.                 Dim phase As String = line
  27.                 Dim words() As String
  28.                 If line.StartsWith("_sceneMesh") Then
  29.                     words = phase.Split("=")
  30.                     numofmeshes += 1
  31.                     mesharry.Add(words(1).ToString)
  32.                 End If
  33.                 line = stream_reader.ReadLine()
  34.             Loop
  35.             stream_reader.Close()
  36.         Catch ex As Exception
  37.             MsgBox(ex.ToString)
  38.         End Try
  39.  
  40.     End Sub
  41.  
  42.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  43.  
  44.     End Sub
  45.  
  46.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  47.         _engine = New TVEngine
  48.         mesharry = New ArrayList
  49.         _scene = New TVScene
  50.         inp = New TVInputEngine
  51.         _engine.SetDebugMode(True, True)
  52.         _engine.SetDebugFile(System.IO.Path.GetDirectoryName(Application.ExecutablePath) + "\debugfile.txt")
  53.         _engine.Init3DWindowed(PictureBox1.Handle, True)
  54.         _engine.SetAngleSystem(CONST_TV_ANGLE.TV_ANGLE_DEGREE)
  55.         Getrmesh()
  56.         For i = 0 To numofmeshes
  57.             _scenemeshes(i) = _scene.CreateMeshBuilder
  58.             With _scenemeshes(i)
  59.                 .LoadTVM(Application.StartupPath + "\scene\" + mesharry(i) + ".Smm")
  60.             End With
  61.         Next
  62.         inp.Initialize(True, True)
  63.         bdoloop = True
  64.         Do While bdoloop
  65.             _engine.Clear(False)
  66.             _scene.RenderAll(True)
  67.             _engine.RenderToScreen()
  68.         Loop
  69.     End Sub
  70. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement