VB .Net 1. Tutorial

Irrlicht.Net is no longer developed or supported, Irrlicht.Net Cross Platform is a much more complete wrapper. Please ask your C# related questions on their forums first.
Locked
gagagu
Posts: 8
Joined: Wed Jul 13, 2005 1:32 pm

VB .Net 1. Tutorial

Post by gagagu »

If anybody interrested in ?

Code: Select all

Imports Irrlicht
Imports Irrlicht.Core
Imports Irrlicht.Scene
Imports Irrlicht.Video

Imports Irrlicht.IO
Imports Irrlicht.GUI

Module Module1

    Sub Main()

        ' path to irrlicht media files
        Dim Irrlichtpath = "C:\copy\irrlicht-0.11.0\irrlicht-0.11.0\media\"


        ' create and set device
        Dim dimension As New Irrlicht.Core.Dimension2D(800, 600)
        Dim device As New IrrlichtDevice(DriverType.OPENGL, dimension, 16, False, False, False, False, Nothing)

        ' set window caption
        device.WindowCaption = "1. Hello World! - Irrlicht Engine Demo"

        ' define driver
        Dim driver As Irrlicht.Video.IVideoDriver
        driver = device.VideoDriver()

        ' define scene manager
        Dim smgr As Irrlicht.Scene.ISceneManager
        smgr = device.SceneManager

        ' define gui environment
        Dim guienv As Irrlicht.GUI.IGUIEnvironment
        guienv = device.GUIEnvironment

        ' add text to gui
        Dim position As New Irrlicht.Core.Rect(10, 10, 200, 22)
        guienv.AddStaticText("Hello World ! This i the Irrlicht Software engine!", position, True, True, Nothing, 0)

        ' load mesh
        Dim mesh As Irrlicht.Scene.IAnimatedMesh = device.SceneManager.GetMesh(Irrlichtpath + "sydney.md2")

        ' add mesh to node
        Dim node As IAnimatedMeshSceneNode = device.SceneManager.AddAnimatedMeshSceneNode(mesh, Nothing, -1)

        ' set mesh parameter
        If Not node Is Nothing Then
            node.SetMaterialFlag(MaterialFlag.LIGHTING, False)
            node.SetFrameLoop(0, 310)
            Dim texSydney As ITexture = device.VideoDriver.GetTexture(Irrlichtpath + "sydney.bmp")
            node.SetMaterialTexture(0, texSydney)
        End If

        ' set camera
        Dim position1 As New Irrlicht.Core.Vector3D(0, 30, -40)
        Dim position2 As New Irrlicht.Core.Vector3D(0, 5, 0)
        smgr.AddCameraSceneNode(Nothing, position1, position2, 0)

        ' main loop
        While (device.Run)
            ' begin scene and clear all
            driver.BeginScene(True, True, New Color(0, 200, 200, 200))
            ' draw all objects in scene manager
            smgr.DrawAll()
            ' draw the gui
            guienv.DrawAll()
            ' end scene
            driver.EndScene()
        End While

        ' close
        device.CloseDevice()

    End Sub

End Module
Locked