Results 1 to 8 of 8

Thread: Irrlicht test

  1. #1
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    68
    Posts
    3,865
    Rep Power
    405

    Irrlicht test

    Having fun, if you downloaded the other md2 files I had put up and have them all in the same directory as Roberto's model, this script will load all 4.

    I tried to guess the command as it would be in thinBasic based on what Roberto did, but either I am wrong about it, or it is not ready yet. I commented those lines out. But they are where I think they should be to position each model in its own spot, at least not all on top of each other as they are now.

    This is fun!!

    [code=thinbasic]' Example 01: Hello World - The GUI

    uses "Irrlicht"

    #include "Irrlicht.inc"

    DIM pIIP as dword
    DIM IIP as IRR_INSTANCE_PTR
    dim mesh(4) as dword
    dim node(4) as dword

    pIIP = VARPTR(IIP)

    ' Create the device
    IRR_CreateDevice(pIIP, %IRR_EDT_SOFTWARE, 640, 480, 32, %FALSE, %FALSE, %FALSE, 0)

    ' Set the title of the display
    IRR_SetWindowCaption(pIIP, "Hello World! - Irrlicht Engine Demo from ThinBASIC")

    ' add a static text object to the graphical user interface, at the moment
    ' this is the only interface object we support. The text will be drawn inside
    ' the defined rectangle, the box will not have a border and the text will not
    ' be wrapped around if it runs off the end
    IRR_AddStaticText(pIIP, "Hello World! This is the Irrlicht Software engine from ThinBASIC!", 10, 10, 260, 22, %TRUE, %FALSE)

    ' To display something interesting, we load a Quake 2 model and display it.
    'mesh = IRR_GetMesh(pIIP, "C:\irrlicht-1.3\media\sydney.md2")
    mesh(1) = IRR_GetMesh(pIIP, "corpse.md2")
    node(1) = IRR_AddAnimatedMeshSceneNode(pIIP, mesh(1))
    mesh(2) = IRR_GetMesh(pIIP, "solo.md2")
    node(2) = IRR_AddAnimatedMeshSceneNode(pIIP, mesh(2))
    mesh(3) = IRR_GetMesh(pIIP, "super.md2")
    node(3) = IRR_AddAnimatedMeshSceneNode(pIIP, mesh(3))
    mesh(4) = IRR_GetMesh(pIIP, "sydney.md2")
    node(4) = IRR_AddAnimatedMeshSceneNode(pIIP, mesh(4))

    ' If everything worked, add a texture and disable lighting
    If node(1) then
    ' IRR_SetNodeFrameLoop(node, 0, 310)
    IRR_SetNodeMD2Animation(node(1), %IRR_EMAT_STAND)
    IRR_SetNodeMaterialTexture(node(1), 0, IRR_GetTexture(pIIP, "corpse.png"))
    IRR_SetNodeMaterialFlag(node(1), %IRR_EMF_LIGHTING, %FALSE)
    'IRR_SetNodePosition(node(1), -5,-2,0)
    end if
    If node(2) then
    ' IRR_SetNodeFrameLoop(node, 0, 310)
    IRR_SetNodeMD2Animation(node(2), %IRR_EMAT_STAND)
    IRR_SetNodeMaterialTexture(node(2), 0, IRR_GetTexture(pIIP, "solo.bmp"))
    IRR_SetNodeMaterialFlag(node(2), %IRR_EMF_LIGHTING, %FALSE)
    'IRR_SetNodePosition(node(2), -2,0,0)
    end if
    If node(3) then
    ' IRR_SetNodeFrameLoop(node, 0, 310)
    IRR_SetNodeMD2Animation(node(3), %IRR_EMAT_STAND)
    IRR_SetNodeMaterialTexture(node(3), 0, IRR_GetTexture(pIIP, "super.bmp"))
    IRR_SetNodeMaterialFlag(node(3), %IRR_EMF_LIGHTING, %FALSE)
    'IRR_SetNodePosition(node(3), 1,2,0)
    end if
    If node(4) then
    ' IRR_SetNodeFrameLoop(node, 0, 310)
    IRR_SetNodeMD2Animation(node(4), %IRR_EMAT_STAND)
    IRR_SetNodeMaterialTexture(node(4), 0, IRR_GetTexture(pIIP, "sydney.bmp"))
    IRR_SetNodeMaterialFlag(node(4), %IRR_EMF_LIGHTING, %FALSE)
    'IRR_SetNodePosition(node(4), 4,5,0)
    end if

    'To look at the mesh, we place a camera into 3d space at the position (0, 30, -40).
    'The camera looks from there to (0,5,0).
    IRR_AddCameraSceneNode(pIIP,0,30,-40,0,5,0)

    ' while the scene is still running
    WHILE IRR_Run(pIIP)
    ' begin the scene, erasing the canvas to white before rendering
    IRR_BeginScene(pIIP, %true, %true, 255, 100, 101, 140)

    ' draw the Graphical User Interface
    IRR_DrawScene(pIIP)
    IRR_DrawGUI(pIIP)

    ' end drawing the scene and render it
    IRR_EndScene(pIIP)
    WEND

    ' Stop the irrlicht engine and release resources
    IRR_Drop(pIIP)
    [/code]
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

  2. #2
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,817
    Rep Power
    10

    Re: Irrlicht test

    Ken,

    sorry but I've splitted you post in order not to have a big mammut thread talking on too many different things.
    I'm happy you are having fun with this. New functions, examples and documentation will come in next weeks.

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  3. #3
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,817
    Rep Power
    10

    Re: Irrlicht test

    Maybe a general purpose MD2 viewer can be easily created
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  4. #4
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    68
    Posts
    3,865
    Rep Power
    405

    Re: Irrlicht test

    THanks for splitting it Eros. I was going to make one last night, but don't know enough of the new commands.

    Also IrrEdit is the free level editor, particle maker, lightmapper and model viewer for irrlicht. I will play with it later this week. This way we can work on tools we need and not reinvent the wheel. It has script support to write plugins it seems. I guess can't decide till we play with it.
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

  5. #5

    Re: Irrlicht test

    Hi Kryton9,

    I'm not able to find yours md2 files, did you removed them?

    Ciao,
    Roberto
    http://www.thinbasic.com

  6. #6
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,153
    Rep Power
    736

    Re: Irrlicht test

    Hi Roberto,

    I think they were never attached.
    But it would be nice to see them in action, kryton - bring'em !


    Bye,
    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  7. #7
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,817
    Rep Power
    10

    Re: Irrlicht test

    Maybe when I moved this post they were deleted.
    Here they are in any case.
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  8. #8
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    68
    Posts
    3,865
    Rep Power
    405

    Re: Irrlicht test

    This post just showed up today in my new, it is Monday May the 7th. Anyways, it looks like Eros got it covered. Thanks Eros.
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

Similar Threads

  1. a 3D web browers using Irrlicht
    By ErosOlmi in forum Software discussion
    Replies: 0
    Last Post: 05-05-2007, 18:25

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •