Page 1 of 5 123 ... LastLast
Results 1 to 10 of 43

Thread: Creating models

  1. #1
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Creating models

    Hi all,

    as I'm thinking about painless use of TBGL, I finally get one idea.

    For creating simple scenes, the built in primitives can be used without any problems. But when you stop to just play with it, and think about really practical use ...

    What about 3D modeller designed exclusively for thinBASIC and TBGL ?!

    Off course, there could be another way - import generally used 3D files some way. I investigated a little bit and get some interesting information.

    3D Studio Max is marvelous tool, but available after paying unbelieveable prize

    Free tool called GMax ( light version of 3D Studio MAX 4 ) is very nice, powerful, but it's difficult to get out data from it. Also I'm afraid that hacking .gmax format is not legal.

    Blender is little bit complicated to handle.


    So I'm again at the beginning

    My idea is to create polygon-based modeller, which would support ( at least ) these features:
    [list][*] Creating objects by defining all types of polygons supported by TBGL[*] Tools like a "Build a wall using two clicks", "Deform terrain", ...[*] Assigning color and texture to each object[*] Possibility to handle model in various layers[*] Export simple file format, easily PARSEable using thinBASIC[*] It would be written using PowerBASIC to take advantage of extreme speed of compiled program but ...[*] ... it would take advantage of power of thinBASIC heavily too! - user could launch it's own thinBASIC scripts to automate various tasks when modelling[/list:u]
    The last point will be much easier when some "inlanguage" thinBASIC SDK will appear for PowerBASIC, similar to one from Eros's previous project - BINT32. But it is posible ( at very restricted level ) even now.

    I have already made some concept-program, but I have to translate the interface and helpfile from Czech to English, so it will take some time before first public testing

    What do you think about it ?


    Thanks,
    Petr

    P.S. Hmm, "thinEdge 3D" could be cool name
    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

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

    Creating models

    Give me the list of what you need and we will try to do our best to implement new thinBasic features.
    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
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Creating models

    Hi Eros,

    briefly, I just need to register functions ( like the ones from DLL modules ) from the 3D editor EXE.

    Maybe something thinBASIC_ActivateInterpreter to tell TB core I will interface with it, then register some functions from the EXE to be able exchange e.g. vertex data. Then the thinBASIC scripts could directly call something like ed_GetVertexX(index), ed_GetNumberOfVertexes, ... without any problems.

    I'm now solving some task as passing it to script command line ( like editor handle ... ). But for 10 000 triangle model it is clumsy .

    Would it be possible ?

    Thanks for your time,
    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

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

    Creating models

    Petr,

    using thinBasic in this way is not possible because thinBasic.exe is mainly a runner for thinCore.dll. And thinCore.dll has a protection schema in order not to allow to use thinCore.dll other than from thinBasic.exe

    Also in our future plan we think to promote thinCore.dll as stand alone script engine for those programmers that wants to use thinBasic as application script engine.

    I will think about how to give direct direct access to thinCore from inside you applicatio. To better understand this, can you provide me an application example with sources (I imagine in PB). I just need something to understand how you are actually using thinBasic.

    Thanks a lot
    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

  5. #5
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Creating models

    Hi Eros,

    my use of thinBASIC in editor is very basic now .

    I just let the user to select which script will be executed and then I use:
    [code=thinbasic]
    ShellExecute ( hOGLWnd, "", CURDIR$+"\Scripts\"+ScriptName$, FORMAT$(hOGLWnd)+"-"+ModelName, "", %SW_SHOWNORMAL)
    [/code]

    Then I can call script like:
    [code=thinbasic]
    USES "OS"
    USES "UI"
    USES "FILE"

    DIM whandle AS DWORD = OS_GETCOMMAND(2)
    DIM modelName AS STRING = OS_GETCOMMAND(3)
    DIM modelBck AS STRING

    IF wHandle = 0 THEN
    MSGBOX 0, "This script must be launched from 3D Editor"
    STOP
    END IF

    MOUSEPTR 1

    CONSOLE_SETTEXTATTRIBUTE (%CONSOLE_FOREGROUND_RED OR %CONSOLE_FOREGROUND_GREEN OR %CONSOLE_FOREGROUND_BLUE)

    CONSOLE_WRITE("The model you are using is : "+modelName )
    CONSOLE_WRITELINE($CRLF + "Press any key to make a backup")

    CONSOLE_SETTEXTATTRIBUTE (%CONSOLE_FOREGROUND_GREEN)

    modelBck = FILE_LOAD(DIR_GETCURRENT+"\Modely\"+TRIM$(modelName, ANY " -"))
    CONSOLE_WRITE( modelBck )
    FILE_SAVE( DIR_GETCURRENT+"\Modely\"+TRIM$(modelName, ANY " -")+".BACKUP", modelBck )

    CONSOLE_SETTEXTATTRIBUTE (%CONSOLE_FOREGROUND_RED OR %CONSOLE_FOREGROUND_GREEN OR %CONSOLE_FOREGROUND_BLUE)

    CONSOLE_WRITELINE($CRLF + "File was backuped")
    CONSOLE_WAITKEY

    WIN_SETFOREGROUND(whandle)
    MOUSEPTR 0
    [/code]

    This script will just save the file with different name, and display it's contens in console ( see the picture ).

    The code of whole editor is about 4 000 lines now, with czech comments and interface.
    Nothing pleasant to read . But if you want I can send it to you.

    It would be ideal, if it would be possible to easily use thinBASIC just like in your BINT32 "Examples\Test01.bas".


    Thanks,
    Petr
    Attached Images Attached Images
    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

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

    Creating models

    Hi,

    just to keep you all in ... suspense

    Here is little demonstration of future use thinEdge ( 3D editor ) >> thinBASIC.
    Loading of models is easy like a one-two-three, and using display lists ... you can get super fast rendering.

    So here is my first demo of potencial of thinBASIC for advanced models in games. This is a just simple demonstration of confused F117 bomber in the hell of exploding shrapnels .

    I choosed F117 because it is so "cubist" dream airplane, that it is easy to modell. And it also looks like a bat

    Hope you like it,
    and remember ... this is just a beginning

    Petr

    UPDATED 10-Jan-2010 to fix some syntax problem. Please note TBGL contains direct support for m15 handling, so this example is considered obsolete from demonstrated approach point of view.
    Attached Images Attached Images
    Attached Files Attached Files
    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,777
    Rep Power
    10

    Creating models

    Just one word: fantastic!

    ADDED:
    the file structure of thinEdge is very clear and easy to use/change/implement.
    I would suggest to add a version number of thinEdge in order to understand with wich version the file was created (possible version incompatibility)

    Also your "meLoadM15File" thinBasic function you have created in F117 example gave me the idea of a new parsing function able to parse and load "rectangular" text buffers in one go. Something like:

    PARSERECT StringBuffer, ArrayName(), LineSeparator, FieldSeparator

    At the end ArrayName will be a 2 dimesional array with all the lines and fields parsed. This should speed-up a lot loading of files.

    Quite easy to implement. Thanks a lot.
    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

    Creating models

    Petr,

    amazing, you make a great work!

    Roberto.
    http://www.thinbasic.com

  9. #9
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Creating models

    Thanks to you both,

    the version info will be added, that's a good idea!
    There is still much work on the editor. For anybody interested there is an BETAVERSION of thinEdge on tbgl pages, but keep in mind it is not well optimized and can cause troubles on various computers . Anyway, any impressions would be appreciated.

    I have now first set of ideas from Eros to implement ( like make it more "Windows look and feel", palletes, speed of cursor movement fix on fast computers ... ) So don't be shy to add new suggestions.


    Thanks,
    Petr

    P.S. PARSERECT function would be greatly appreciated ! Good idea !
    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

  10. #10
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Creating models

    Hi,

    just to keep you updated.

    I added some new stuff regarding thinEdge, thinBASIC file loading routines + screenshots on the tbgl pages.

    Hope you like it. I hunted some bugs, added support for loading Wavefront OBJ 3D files and at last the transparency of layers works as it should

    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

Page 1 of 5 123 ... LastLast

Similar Threads

  1. Models
    By kryton9 in forum Media material
    Replies: 96
    Last Post: 04-03-2010, 15:18

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
  •