Page 3 of 5 FirstFirst 12345 LastLast
Results 21 to 30 of 46

Thread: Irrlicht module: unofficial preview 3

  1. #21
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    50
    Posts
    8,187
    Blog Entries
    2
    Rep Power
    10
    WSTRING are UNICODE strings while thinBasic strings are ascii strings.
    Use UCODE$ to convert your string from ascii to UNICODE string when WSTRING is needed
    www.thinbasic.com | www.thinbasic.com/community/ | psch.thinbasic.com
    Win10Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

  2. #22
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    6,796
    Blog Entries
    3
    Rep Power
    693
    Your code:
    '1) --------------------->
    '#define IRR_OFF 0
    %IRR_OFF = 0
    
    '#define IRR_ON 1
    %IRR_ON = 0            
    
    '2) --------------------->
    'TYPE irr_node As LONG Ptr
    Type irr_node 
         irr_node As Long Ptr
    End Type
    
    'Type irr_gui_object as Any Ptr
    Type irr_gui_object 
      irr_gui_object  As Any Ptr    
    End Type
    
    'TYPE irr_mesh as LONG PTR
    Type irr_mesh ' doesn't work  for loading objects 
      irr_mesh As Long Ptr
    End Type
    
    can be converted as:
    '1) --------------------->
    '#define IRR_OFF 0
    %IRR_OFF = 0
    
    '#define IRR_ON 1
    %IRR_ON = 1           ' ! -- You probably forgot this by accident :)  
    
    '2) --------------------->
    'TYPE irr_node As LONG Ptr  
    Alias DWord As irr_node       ' -- it serves to store 32bit address to LONG
    
    'Type irr_gui_object as Any Ptr                              
    Alias DWord As irr_gui_object ' -- it serves to store 32bit address to anything
    
    'TYPE irr_mesh as UINTEGER PTR
    Alias DWord As irr_mesh       ' -- it serves to store 32bit address to DWORD
    

    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 7 64bit - Intel Core 2 Duo T6600 @ 2.2GHz - 4 GB RAM - NVIDIA GeForce G210M 512MB
    Windows 8 64bit - Intel Core i5-3350P @ 3.1GHz - 8 GB RAM - NVIDIA GeForce GT640 3GB

  3. #23

    irrlicht_example01 is running!

    well, here we are the first "hello irrlicht" example perfect running!
    thanks to petr ("Alias DWord As" ) and eros (Ucode$) again for help.

                                      ' Empty GUI script created on 06-07-2011 18:31:07 by largo_winch 
    ' Empty GUI script created on 06-08-2011 18:37:00 by largo_winch
    
    '' Includes for extension libraries
    #INCLUDE "Irrlicht_lw1b.inc"
    
    Uses "console"
                                         
    IrrStart (%IRR_EDT_OPENGL, 500, 400, 32,_ ' '%IRR_BITS_PER_PIXEL_32
              %IRR_WINDOWED, %IRR_NO_SHADOWS, %IRR_IGNORE_EVENTS,_  '
              %IRR_VERTICAL_SYNC_ON )
    
    ' Set the title of the display
    IrrSetWindowCaption(Ucode$ ("Example 01: Hello Irrlicht_World") )
    
    IrrAddStaticText(Ucode$("Hello Largo's Irrlicht_World"), 15,20,400,64, %IRR_GUI_NO_BORDER, %IRR_GUI_NO_WRAP, IRR_GUI_OBJECT) 'type: IRR_GUI_OBJECT is important !
    
    PrintL, IrrGetFPS  'see result in console window!
    
    ' while the scene is still running
    While IrrRunning
        ' begin the scene, erasing the canvas to white before rendering
        IrrBeginScene( 55,255,255 )
    
        ' draw the Graphical User Interface
        IrrDrawGUI
    
        ' end drawing the scene and render it
        IrrEndScene
    Wend
    
    ' ----------------------------------------------------------------------------->
    ' Stop the irrlicht engine and release resources
    IrrStop
    
    example and new irrlicht include file you find in zip file. Give feedback if there are problems with running this example. must working fine!

    bye, largo
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	irrlicht-test2b-lw-go.jpg 
Views:	134 
Size:	6.7 KB 
ID:	7273  
    Attached Files Attached Files
    Last edited by largo_winch; 08-06-2011 at 19:09.

  4. #24

    Engine based on Irrlicht

    I found some interesting game engine fully based on IrrLicht and Newton. Here the link to offical site.

    Overview:
    N3xtD engine project is aimed specifically the 'alternative' languages (such as Basic, for example). He is compiling a number of known and proven tools like Irrlicht (v1.8.x) for graphics, Newton for the physical part, and some part of proprietary code, designed to improve overall.
    This project is oriented primarily towards simplicity and ease of implementation, even if it is as complete as possible.

    This engine has ports to PureBasic, FreeBasic, BlitzMax. This engine has more features then FreeBasic IrrLicht wrapper. Download page.

  5. #25

    new irrlicht examples with 3d models

    here now I show four new irrlicht examples with thinbasic. feel free for testing. only the mouse control in dungeon-collision example doesn't work fully satisfied I will check if I can change that for next time.

    it's good feeling to see the model and the rooms and the scene with living objects (models)

    feedback is important if these examples are working for you. all files in zip folder.

    notation: only files with 3.8 mb files I can upload. it's possible to change that limitation?

    thinbasic_irrlicht include file was updated.

    eros please change that in thinbasic-code script example again, here I have some problems with code tags, sorry!:

    '' ---------------------------------------------------------------------------- '' Irrlicht Wrapper for Imperative Languages - Freebasic Examples '' Frank Dodd (2006) '' ---------------------------------------------------------------------------- '' Example 08: Shadows and Lights '' This example loads a map and a model into the scene and then applies realtime '' shadows to the model cast from lights in the scene that can be seen on the '' surface of other objects. '' ---------------------------------------------------------------------------- ' ' >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ' TRANSLATION: Empty GUI script created on 06-16-2011 15:21:58 by largo_winch (ThinAIR) ' >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> #INCLUDE "Irrlicht_lw1c.inc" Uses "console" '' //////////////////////////////////////////////////////////////////////////// '' global variables ' irrlicht objects Dim MD2Mesh As irr_mesh Dim MeshTexture As irr_texture Dim SceneNode As irr_node Dim BSPMesh As irr_mesh Dim BSPNode As irr_node Dim OurCamera As irr_camera Dim Light As irr_node ' ----------------------------------------------------------------------------- ' start the irrlicht interface '500, 400 IrrStart( %IRR_EDT_OPENGL, 600, 500, %IRR_BITS_PER_PIXEL_32, %IRR_WINDOWED, _ '200 %IRR_SHADOWS, %IRR_IGNORE_EVENTS, %IRR_VERTICAL_SYNC_ON ) ' send the window caption IrrSetWindowCaption( Ucode$("TB_Example 08: Shadows and Lights. / alt+F4: close window" )) ' load the MD2 model from example 4 into the scene 'MD2Mesh = IrrGetMesh( "./media/zumlin.md2" ) MD2Mesh = IrrGetMesh( "./media/super.md2" ) 'MeshTexture = IrrGetTexture( "./media/zumlin.pcx" ) MeshTexture = IrrGetTexture( "./media/super.bmp" ) SceneNode = IrrAddMeshToScene( MD2Mesh ) IrrSetNodeMaterialTexture( SceneNode, MeshTexture, 0 ) IrrSetNodeMaterialFlag( SceneNode, %IRR_EMF_LIGHTING, %IRR_OFF ) IrrPlayNodeMD2Animation( SceneNode, %IRR_EMAT_STAND ) ' load the bsp map from example 5 into the scene IrrAddZipFile( "./media/map-20kdm2.pk3", %IRR_IGNORE_CASE, %IRR_IGNORE_PATHS ) BSPMesh = IrrGetMesh( "20kdm2.bsp" ) BSPNode = IrrAddMeshToSceneAsOcttree( BSPMesh ) ' move the map into position around the model IrrSetNodePosition( BSPNode, -1370,-88,-1400) ' add a camera into the scene OurCamera = IrrAddCamera( 50,0,0, 0,0,0 ) ' switching shadows on is very simple just call the command for the scene node ' that you want to cast shadows IrrAddNodeShadow( SceneNode,0 ) ' the shadow colour is a global property for the whole scene (however you can ' change it as you move into different areas of your scene) the first ' parameter is the alpha blend for the shadow this shadow is half washed out ' which gives the appearence of ambient light in the room illuminating the ' shadowed surface, the second set of numbers defines the color of the shadow ' which in this case is black IrrSetShadowColor( 128, 0, 0, 0 ) ' finally we need to add a light into the scene to cast some shadows. when using ' shadows you probably only want one or two lights as they can be time consuming ' the first set of parameters for this light specify the position its created ' at, the second set of parameters define the color - rather than 255 integer ' levels the intensity of red/green/blue is defined from 0 to 1 and finally ' you define the radius of effect of the light Light = IrrAddLight( %IRR_NO_PARENT, 100,100,-100, 0.9,0.3,0.3, 600.0 ) ' the second light is an ambient light and illuminates all surfaces in the scene ' uniformly. this is usually a low value that is used to change the lighting ' level across the entire scene IrrSetAmbientLight( 0.1, 0.1, 0.1 ) ' ----------------------------------------------------------------------------- ' while the irrlicht environment is still running While IrrRunning ' begin the scene, erasing the canvas with sky-blue before rendering IrrBeginScene( 240, 255, 255 ) ' draw the scene IrrDrawScene ' end drawing the scene and render it IrrEndScene Wend ' ----------------------------------------------------------------------------- ' Stop the irrlicht engine and release resources IrrStop
    bye, largo
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	shadows+light+3dmodel.jpg 
Views:	217 
Size:	53.2 KB 
ID:	7289  
    Attached Files Attached Files
    Last edited by largo_winch; 17-06-2011 at 12:27.

  6. #26
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    50
    Posts
    8,187
    Blog Entries
    2
    Rep Power
    10
    Hi largo,

    can you please try to repost the code because it seems it missed line feed
    www.thinbasic.com | www.thinbasic.com/community/ | psch.thinbasic.com
    Win10Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

  7. #27
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    50
    Posts
    8,187
    Blog Entries
    2
    Rep Power
    10
    Quote Originally Posted by largo_winch View Post
    notation: only files with 3.8 mb files I can upload. it's possible to change that limitation?
    Thanks a lot, examples work great.
    I just needed to download from the web missing Microsoft C library msvcp71.dll (I think it is needed by IrrlichtWrapper.dll wrapper)

    Attachments limit for .ZIP file changed to 5Mb, hope it is enough

    Eros
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	img1.jpg 
Views:	155 
Size:	74.3 KB 
ID:	7291   Click image for larger version. 

Name:	img2.jpg 
Views:	133 
Size:	38.7 KB 
ID:	7292   Click image for larger version. 

Name:	img3.jpg 
Views:	141 
Size:	69.7 KB 
ID:	7293   Click image for larger version. 

Name:	img4.jpg 
Views:	130 
Size:	17.7 KB 
ID:	7294  
    www.thinbasic.com | www.thinbasic.com/community/ | psch.thinbasic.com
    Win10Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

  8. #28
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    6,796
    Blog Entries
    3
    Rep Power
    693
    Hi,

    the examples are very nice, all of them ran without problem, except the irrlicht-collision-dungeon, where the camera movement on my PC was very slow (moved mouse by 40cm -> rotated by ~2 degrees).

    This problem could be fixed by changing the rotation speed:
    Camera = IrrAddFPSCamera(0,25,1,100.0,0.5,-1,0,irr_camera)
    
    ... but I am not sure if this fix is not just for my PC only. I am not sure what units the rotateSpeed uses.


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 7 64bit - Intel Core 2 Duo T6600 @ 2.2GHz - 4 GB RAM - NVIDIA GeForce G210M 512MB
    Windows 8 64bit - Intel Core i5-3350P @ 3.1GHz - 8 GB RAM - NVIDIA GeForce GT640 3GB

  9. #29
    All samples working good.

    1st PC:
    • OS: Windows 7 x86 Ultimate
    • Core: AMD Phenom X3 8750 2.4Ghz
    • Mem: 2Gb DDR2 1066Mhz
    • Video: NVIDIA GeForce 8800 GT 512Mb

    2nd PC:
    • OS: Windows XP x86 Professional
    • Core: Intel E5800
    • Mem: 1Gb DDR 400Mhz
    • Video: AMD Radeon HD2600XT 512Mb

    A little later, testing on two laptops.

  10. #30

    fixed dungeon-collision example

    thanks bezumec, eros, petr for testing. I have found the problem some minutes before (I was too tired last night to check all features!), the camera speed rotation wasn't high enough. so you can use 50.0 or 100.0 for this. same thing petr has found (thanks!) for error checking.

    these lines are important. the second value of IrrAddFpsCamera(0,50...) is important.
    '-------------> Important -------------------------------------->
    ' next we add a first person perspective camera to the scene
    Camera = IrrAddFPSCamera(0,50.0,1,100.0,0.5,-1,0,50) ' second number (50) gives speed rotation!
    '-------------> Important -------------------------------------->
    Internetsurfing: I am using at the moment linux and mozilla firefox, but I have some problems with code tags, don't know why.

    Here a new fixed version of "dungeon-collision12a" example in zip file. Copy this file into first folder above. You can now move (and jump) through whole SCENE! That's really exciting !

    eros thanks for that:
    Attachments limit for .ZIP file changed to 5Mb, hope it is enough
    I will check if other irrlicht examples can work too for thinbasic. but I need time.

    @bezumec: "N3xtD_FreeBasic.zip" can you check the link for me? or please give a link where I can download (right-click-mouse) to save download file? I have some problems here at the moment. Thanks for the link! (problem solved, downloaded file from another pc machine at work)

    bye, largo
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	collision-dungeon12a-go.jpg 
Views:	136 
Size:	40.5 KB 
ID:	7296  
    Attached Files Attached Files
    Last edited by largo_winch; 20-06-2011 at 09:50.

Page 3 of 5 FirstFirst 12345 LastLast

Similar Threads

  1. Irrlicht module: 2nd unofficial preview
    By ErosOlmi in forum Irrlicht
    Replies: 11
    Last Post: 08-05-2007, 10:31

Tags for this Thread

Posting Permissions

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