There you go: copy/paste into a new VB.Net form:
Public Class Form1
Private _tvEngine As New MTV3D65.TVEngine
Private _tvScene As New MTV3D65.TVScene
Private _tvPhysics As New MTV3D65.TVPhysics
Private _tvMesh As MTV3D65.TVMesh
Private _tvLandscape As MTV3D65.TVLandscape
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' ******************************
' *** INIT ***
' ******************************
' Init engine
With _tvEngine
.SetDebugMode(True)
.Init3DNoRender(Me.Handle)
End With
' Init the physics
_tvPhysics.Initialize()
' Create physics materials
Dim iMatLandscape As Integer = _tvPhysics.CreateMaterialGroup("MatLandscape")
Dim iMatMesh As Integer = _tvPhysics.CreateMaterialGroup("MatMesh")
Dim iMatEmpty As Integer = _tvPhysics.CreateMaterialGroup("MatEmpty")
' Create empty body
Dim iEmptyBody As Integer = _tvPhysics.CreateBody(100)
_tvPhysics.SetBodyMaterialGroup(iEmptyBody, iMatEmpty)
' Create landscape
_tvLandscape = _tvScene.CreateLandscape("Landscape")
_tvLandscape.CreateEmptyTerrain(MTV3D65.CONST_TV_LANDSCAPE_PRECISION.TV_PRECISION_BEST, 1, 1, 0, 0, 0)
Dim iLandscapeBody As Integer = _tvPhysics.CreateStaticTerrainBody(_tvLandscape)
_tvPhysics.SetBodyMaterialGroup(iLandscapeBody, iMatLandscape)
' Create mesh
_tvMesh = _tvScene.CreateMeshBuilder("Mesh")
_tvMesh.CreateBox(1, 1, 1)
Dim iMeshBody As Integer = _tvPhysics.CreateMeshBody(100, _tvMesh, MTV3D65.CONST_TV_PHYSICSBODY_BOUNDING.TV_BODY_BOX)
_tvPhysics.SetBodyMaterialGroup(iMeshBody, iMatMesh)
' ******************************
' *** QUIT ***
' ******************************
' Unload mesh
_tvMesh.Destroy()
_tvMesh = Nothing
' Unload landscape
_tvLandscape.DeleteAll()
_tvLandscape = Nothing
' Unload physics
With _tvPhysics
.DestroyBody(iLandscapeBody, False)
.DestroyBody(iMeshBody, False)
.DestroyBody(iEmptyBody, False)
.Unload()
End With
_tvPhysics = Nothing
' Unload scene
_tvScene = Nothing
' Unload engine
_tvEngine.ReleaseAll()
_tvEngine = Nothing
' Quit
MsgBox("Quit normally")
End
End Sub
End Class