Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: 3D graphics for fun !

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

    3D graphics for fun !

    Hi,

    although 3D module for thinBASIC could be used for more serious problems, it's useful for games too.

    In this thread you will meet some thinBASIC games during some time.

    I'll start with very simple example - space shoting game.
    In this game you have to control small spaceship captured by wormhole.

    Your only job is to shoot the dangerous flying boxes to achieve better score.

    This game was tested with thinBASIC 1.0.6.4 and with TBGL module version 0.1.5

    Enjoy,
    Psch
    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

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

    3D graphics for fun !

    Thanks Petr what a fantastic learning example.
    On my PC it is too fast. I've added a SLEEP 1 just before WEND in main game loop in order to be able to move and fire.

    Roberto will like it.

    wow
    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,129
    Rep Power
    732

    3D graphics for fun !

    Hi,

    I'm happy you like it. It's just the beginning

    On my PC it is too fast
    you have computer from NASA ?
    ... and I thought I had to optimize the code even more

    Yes, the not existing "constant speed" setup is my fault.
    It's easy to add ( all movements in the scene will be dependent on current framerate ).

    I'v updated the sample. If you have time, please let me know if it works.

    Thanks,
    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,782
    Rep Power
    10

    3D graphics for fun !

    Yes, it's from NASA .
    That's the reason why
    FrameRate = (1/(ThisTime-LastTime))*1000
    "gives division by zero" error
    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,129
    Rep Power
    732

    3D graphics for fun !

    Oh, these NASA computers

    Silly me
    I was afraid of this issue, the only solution which occurs to me now is:

    FrameRate = (1/(ThisTime-LastTime+0.001))*1000

    I know it's nasty a bit, but it should work even on NASA boxes .

    Thanks a lot, I'll update the file again,
    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

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

    3D graphics for fun !

    Working fine, now.

    I'm not in front of my NASA pc now.
    In current PC (P4 2.8Gh, 1Gb RAM) frame rate is 65.
    I will let you know frame rate on NASA one later.

    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

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

    3D graphics for fun !

    Thanks for info,

    I'm getting the 65 - 100 FPS too on my box ?! ( Duron 850MHz, 320 MB RAM, Radeon 9600 @ WinME ). I'v discovered that XP's "eats" some performance in some cases - but not in case of your NASA one

    Thanks,
    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

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

    3D graphics for fun !

    Well I think the hard work is done by the OpenGl driver and the graphic card.
    My NASA box is an AMD Athlon 64Bit 3700+. It very fast. Graphic card is a Radeon x600 pro with 256Mb and here SpaceShooterGame.tBasic runs at a fixed 100Fps .

    Good work.
    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

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

    3D graphics for fun !

    Well, that's really NASA configuration !

    You're right about the OpenGL driver and graphic card. In the early times of XP's the drivers were bit weak, so that was the XP-performance-eater cause.

    Now it seems OK, we'll see what kind of surprises the Windows Vista will bring

    Thanks,
    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

  10. #10

    3D graphics for fun !

    Hi Psch,

    I'm amazed, great!
    It's very exciting build it a bit at time isn't it?

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

Page 1 of 2 12 LastLast

Similar Threads

  1. easiest graphics with c++
    By zak in forum Science
    Replies: 0
    Last Post: 06-07-2011, 11:56
  2. Graphics Tablets
    By kryton9 in forum General
    Replies: 8
    Last Post: 11-08-2007, 19:43

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
  •