Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: Boids - group AI implemented in ThinBASIC

  1. #11
    Senior Member Lionheart008's Avatar
    Join Date
    Sep 2008
    Location
    Germany, Bad Sooden-Allendorf
    Age
    52
    Posts
    944
    Rep Power
    111
    hi petr,
    the actor_* and animator_* files are just include files, which are not supposed to be launched separately. The Boids_DemoApp.tBasic is the main application which uses them.
    .. it's for me still unusual to use tbasic files as include files, so I was confused for a moment, but I understand your project tree (*grinning*). I will try to use it for one of my next tbgl example.

    here is another question:

    a) it's possible to texture irregular (not plane) formed object (tbgl_vertex, tbgl_ngon), I mean no cube or triangles, with mapped texture: perhaps for another example a nurbs surface ?
    b) how would you texture such a fish? ( in general)
    c) what about speed behaviour if you are using three, four different texture for rendering ? do you have any experiences with rendering speed in such cases? that's a problem I am running in my mind at the moment, because I've got quite different framerates with textured background in one of my powerbasic openGL examples.. so I can imagine that's same problem for tbgl behaviour (or you have already missed this lack! )

    best regards, thanks, frank
    Last edited by Lionheart008; 10-12-2010 at 12:21.
    you can't always get what you want, but if you try sometimes you might find, you get what you need

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

    yes, using tBasic for includes is not very usual. I will talk to Eros about possibility to create new extension, such as .tBasicU (unit) for thinBASIC, as .inc used till now is quite common in other BASICs as well, so it sometimes opens in wrong IDE when you click it. That is why I stopped using this extension of my TB projects.

    a) I am not sure I understand the question . Any shape you design using todays graphics hardware (maybe with exception of points and lines) is represented as triangular mesh. So texturing single triangle can be done the same way as multiple triangles. I do not like the glu implementation of NURBS, that is why I do not post examples on it. It could be nice to create own implementation of it, but that would mean some time spending on it and currently I do not have any use for it.

    b) I would probably texture fish in the 3D editor of my choice, then export it to OBJ, convert to M15 and use it in script.

    c) Texturing is operation where few common rules apply, and other depend simply on hardware horsepower. It is ok to have multiple textures, but what affects the performance most is generally is:

    • how often do you change the active texture. The less changes, the better performance.
    • dimensions of the texture. Even on modern hardware, the power of two textures usually give better performance than images of "any size". Large resolution textures (8192x8192) are slightly slower to process than smaller ones.
    • which filtering mode is activated. Anisotropic filter is the nicest one, but also the most expensive performance wise. The mip mapping (aka trilinear filtering) can be faster, but it occupies more memory, because from each texture there are clones done - if you have 512x512 texture, it is internally stored as 512x512+256x256x128x128+... set of textures, which are then looked up by the rasterizer... and so on


    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

  3. #13
    Senior Member zak's Avatar
    Join Date
    Dec 2008
    Posts
    637
    Rep Power
    83
    a fantastic project, ( unbelievable ), thanks Petr, i guess in the code "which i can't follow now" no single fish will collide with other fish, so this is usefull in ai machines in which it is prohibited for it to collide with environment objects.
    in my viewing i changed fog density to "1" so i can recognise the fishes more.
    zak

  4. #14
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,153
    Rep Power
    736
    Thanks Zak, I somehow missed your reply

    I posted slightly modded BoidsEnhanced.zip demo to the first post of this thread, where visibility is much better and you have more controls (rotating view, changing camera, limiting space for fishes...).


    Petr
    Last edited by Petr Schreiber; 08-01-2011 at 22:24.
    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

  5. #15
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,817
    Rep Power
    10
    I promoted this thread as Article in Article area.
    Too great example to miss it.
    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

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Article: Boids - group AI implemented in ThinBASIC
    By Petr Schreiber in forum vBCms Comments
    Replies: 0
    Last Post: 09-01-2011, 11:53

Members who have read this thread: 0

There are no members to list at the moment.

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
  •