View Full Version : TBGL tutorial
Petr Schreiber
04-12-2005, 21:49
Hi,
I'm thinking about writing some kind of tutorial, which should help you to manage full power of TBGL module.
I'd like to start with basics and then show some "tricks" and techniques of using it.
If you have some special wish regarding the topic of tutorials, please let me know here. It would be very appreciated.
Thanks,
Psch
RobertoBianchi
05-12-2005, 09:40
Hi Psch,
for now no special wishes but I'm looking forward for TBGL tutorial!
Thank you very much and best regards,
Roberto
ErosOlmi
05-12-2005, 11:53
Hi Psch,
in next thinBasic release I will include officially TBGL (as you kindly agree) so a tutorial will be very appreciated.
I think games can be of great interest. Little games, maybe a copy of some game already known. I'm not an expert but something like Space Invaders, even if rudimental, or other games can be interesting, even if under 2D. How to make objects, how to move them, how to check if collision.
Another point is: for what purposes can thinBasic + TBGL used?
A list of possible usage areas can be intersting. Games, representing 3D spaces, creating training material for school (geometry or math?), animating some long tasks like file find or some repetitive tasks or a 3D representation of URL contained in a web page or ...
Just fast thoughts
Eros
Petr Schreiber
05-12-2005, 12:00
Thanks to you both,
Eros, what a number of very good ideas !
I was thinking of just simple -using colors-loading textures-blabla :)
I will do this basics of course, but the idea of game remake / using TBGL for real-life tasks - thats brilliant !
I'll try to do my best.
Thanks a lot,
Psch
ErosOlmi
05-12-2005, 12:24
Your "normal" is far enough !
But if you do your "best", I'm pretty sure it will be a success!
Thanks
Eros
Petr Schreiber
21-01-2006, 21:57
Hi,
I'm working on the tutorials now. First 3 beginners "lessons" are available on temporary web site (http://psch.dingosoft.cz/ENGLISH/index.html).
The tutorials on TBGL are designed as commented ( highlighted :) ) source code + related script file to download
I will try to update them every 3-4 days. This doesn't mean the guarantee of new tutorial every 3 days, but it means at least some additions to the current ones or something like it.
I know they are not perfect now, so any suggestions from your side regarding the style/theme of tutorials is welcome !
I'm now trying to follow the tutorial model Eros proposed.
Thanks,
Petr
ErosOlmi
23-01-2006, 20:22
Good starting Petr.
I will study it. I like 2D/3D graphics but I need to go back to my math paper to refresh 3D handling (especially matrix).
Thanks a lot for your support
Eros
Petr Schreiber
23-01-2006, 20:34
Hi Eros,
You made me think I could do something "behind the magic" :) special lesson about the conception of 3D in TBGL.
It's good to study some material about matrix, but believe me, with TBGL/OpenGL there is not such high need for this, when you want to do just graphics.
For example famous matrixes, which can help to rotate / translate points in 3D space, can sleep in your exercise book :), because rotating / translating of the matrix is automatically done by TBGL_Rotate, TBGL_Translate.
And it's faster than manually performing SIN / COS translations for each vertex.
The tutorial I'm currently writing ( #4 ) will have some info on that.
Thanks,
Petr
Petr Schreiber
28-01-2006, 17:07
Hi,
if you didn't noticed it, there are 2 new tutorials uploaded on the site (http://psch.dingosoft.cz/ENGLISH/index.html).
The lesson #4 is about matrix :) and #5 enlights some details of texturing.
Bye,
Petr
Petr Schreiber
17-02-2006, 21:40
Hi,
for anybody interested - I'v updated downloadable scripts for Lesson #6 of my TBGL tutorials.
Now you can control the light position just by moving the mouse over the window ! This is one of the things, which are possible now thanks to Eros modifications to message pump some time ago.
So you can have a look at it, if you want, on TBGL site (http://psch.dingosoft.cz/ENGLISH/index.html).
Petr
RobertoBianchi
18-02-2006, 09:12
Hi Psh,
indeed you make a great work!
I'm waiting for game tutorial, because in my wish list there is an entry like I WANT WRITE A GAME but I never tryed :oops:
Thank you.
Roberto
Petr Schreiber
18-02-2006, 11:53
Hi Roberto,
don't worry, I'm now working on the game tutorials.
I'will start with "replicating" of early classics games, and then I will try to follow timeline of game development. So from "Pong", "Alien Invaders", "Wolfenstein3D", "Tomb Raider" to "DOOM 3" :lol:.
I will follow the "action" line of the games, because adventure games ( although I love them ) are little bit time consuming, and Catventure seems to be far more experienced than me.
Hope you will like it.
If you have any special wish tell me.
Thanks,
Petr
RobertoBianchi
20-02-2006, 09:22
Hi Psch,
no special wish because your timeline
So from "Pong", "Alien Invaders", "Wolfenstein3D", "Tomb Raider" to "DOOM 3" is really enough for me :wink:
Ciao,
Roberto
Petr Schreiber
20-02-2006, 17:14
OK :),
I'v posted first script - source for the well known "Pong" game - on TBGL web.
As it is very simple game, I didn't make a special tutorial, it's just frequently commented code.
The more complex games, which will follow, will have some extra page with information. Hope you'll like it.
Petr
RobertoBianchi
20-02-2006, 19:43
Hi Petr,
I downloaded the pong's script, great! I'll take a closest look.
Thanks,
Roberto
ErosOlmi
20-02-2006, 21:57
nice, nice, niiiiiiiiiice
thanks
eros
Petr Schreiber
21-02-2006, 12:16
Thanx guys!
I'm now working on the next mini-game. It is very similar to "Space Invaders", or maybe more like "Xenon" or "Raptor" ( the last one was shareware megahit in early 90's :) ).
It will contain simple, but not yet presented solution for "masked" images.
I hope to release it till the end of week.
Bye,
Petr
catventure
22-02-2006, 10:16
Woohoo, Psch. "Space Invaders"!
This would SOUND great too.
Roll on thinBASIC sound commands!
Best wishes,
catventure
Petr Schreiber
22-02-2006, 21:08
Hi Catventure,
good idea ! The only problem is where get the appropiate sounds.
I will try to hunt it from some free sound collection.
Thanks,
Petr
Petr Schreiber
26-02-2006, 20:58
Hello,
sadly, I can't manage to complete the tutorial today.
Some other things interferenced with my happy developing, and I'm also still searching for good and free sound of explosion.
To prove I have something already done, see the screenshot :)
Thanks,
Petr
ErosOlmi
28-02-2006, 03:30
Petr,
sorry but I was not fast enough to save all attached files before our provider take old server off. Can you please post again latest game image? Name of the file should be "game2webb_195.jpg"
Thanks and sorry :oops:
Eros
Petr Schreiber
28-02-2006, 09:31
It's OK,
I'm lazy to delete old files on my PC so the image was still in the folder :D.
If this was the only problem when moving thinbasic site to dedicated server, than there's no problem at all :).
Thanks,
Petr
Petr Schreiber
05-03-2006, 13:08
Hi,
the preview version of game2 ( space shooter like ) is available on
TBGL tutorial pages (http://psch.thinbasic.com/), in section "Game tutorials".
It still lacks sounds, because it's hard to get explosion sound for free :), but the sound engine is included, just REMed out.
To fully enjoy the game, get latest thinBASIC preview - it offers perfect speed boost
Now who will get over score 1000 8)
Petr
ErosOlmi
05-03-2006, 13:48
Here it is :D
ErosOlmi
05-03-2006, 13:50
How do you capture screenshots?
Do you use TBGL function TBGL_SaveScreenshot ?
Petr Schreiber
05-03-2006, 14:45
Hi Eros,
how could you pass the 1000 :lol:
I used Alt+PrintScreen + Ctrl+V to IrfanView, but ...
the tbgl_Screenshot function could be more convenient.
To enable it's use, just follow this two steps:
* Declare integer class variable, for example
DIM ImgCounter AS LONG
* Capture key and write image
Add this on line BELOW tbgl_DrawFrame ( to see finished image )
IF GETASYNCKEYSTATE(%VK_S) THEN ' S like a screenshot :)
INCR ImgCounter
tbgl_SaveScreenShot APP_SOURCEPATH+"Screenshot_"+FORMAT$(ImgCounter)
END IF
This will save screenshots with increasing number as BMP files in both fullscreen and windowed mode.
Bye,
Petr
ErosOlmi
06-03-2006, 02:39
:evil5:
ErosOlmi
06-03-2006, 17:05
:eusadance:
Petr Schreiber
06-03-2006, 17:25
Hi,
After minutes of terrible fight, I overrun your score 8)
Petr
Michael Hartlef
16-09-2008, 10:43
OK :),
I'v posted first script - source for the well known "Pong" game - on TBGL web.
As it is very simple game, I didn't make a special tutorial, it's just frequently commented code.
The more complex games, which will follow, will have some extra page with information. Hope you'll like it.
Petr
Sorry Petr for digging this old topic out of the dirt, but can you point me to the PONG tutorial that you wrote? I have a lot of free time right now at work and was thinking about writing such a tutorial and then found this topic. So where is it? :D
Petr Schreiber
16-09-2008, 14:36
Hi Mike,
the code was so obsolete I put it out after remaking website :)
I did new version for you, putting obosolete constructions out.
It had not text commentary, just lot of comments in code.
Petr
Michael Hartlef
16-09-2008, 14:57
Thanks for reporting. I might still create something.