Hi Stan,
i have to go to work now and look at the code tonight if noone beats me
to it. What do you mean by difficult for tbgl?
Michael
Hi Petr, Eros, and Michael,
I'm attaching a neat little program from FreeBasic which I translated from C. The original program was from a math professor friend of mine, George Francis (at U of I... George uses my Python OpenGL text with his REU freshmen).
I would like to translate this program to thinBasic, but the glGetFloatv command, which fetches the aff() matrix (affine matrix) in the chaptrack() function seems problematic. Heck, there are a few other commands that are difficult for this thinBasic newbie, also!
Anyway, if time permits, please take a look and see if anything can be recommended?
What I like about this program is that it allows you to visualize 3D parametric surfaces and rotate them "trackball" style with the mouse (there is a python version in my text, also).
The tro.zip file contains both the .bas file and the .exe file.
Thanks,
Stan
Hi Stan,
i have to go to work now and look at the code tonight if noone beats me
to it. What do you mean by difficult for tbgl?
Michael
Hi Stan,
if you need OpenGL functions, they are available via headers.
You include them to script this way:
as demonstrates TBGL_UsingAPI.tBasic sample script. So that's the way if you need to port the code line by line. You can freely mix TBGL and OpenGL code as you need.#INCLUDE Once "%APP_INCLUDEPATH%\thinbasic_gl.inc" #INCLUDE Once "%APP_INCLUDEPATH%\thinbasic_glu.inc"
GLUT is not present in thinBasic, as its (in my opinion) unlucky architecture forcing the organization of program sparked the idea to start creating TBGL giving programmer more freedom back in 2005.
The 3D function plotting is quite popular topic in ThinBASIC, recently the user zak presented nice implementation here:
http://www.thinbasic.com/community/s...1268#post81268
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
Why not take advantage of ability to draw in 3D to dialog?
Why not evaluate expressions on the fly?
Here goes example which allows both mouse manipulation of the 3D plot, but also definition of the function on the fly. All that in resizeable ThinBASIC dialog.
Petr
Last edited by Petr Schreiber; 11-11-2010 at 14:39.
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
Petr,
you have the ability to ... amaze your readers.
Great example
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
Hi Michael,
As a thinBasic and TBGL beginner, I did not see the possibility of using raw OpenGL code... but Petr has set me on the correct path!
I'll echo Eros... Petr has the ability to amaze!
I now have a nice programming project for the weekend!
Thanks for the reply,
Stan
Thanks Petr,
Great information... I wasn't aware that I could include opengl headers. Now I have a project for the weekend!
GLUT is an odd (and old) window management system, but unfortunately for me, that is how I learned to use OpenGL. However, it is possible to teach an "old dog" new tricks and I can learn another (better) method.
It's going to be fun working with and learning thinBasic! I can already see that there are no real limitations to anything we need to accomplish.
Thanks again,
Stan
Thanks Stan,
I am happy it worked for you.
I grew up on GLUT as well, I slept with its printed specification under pillow, but there was a moment I realised I need more control - especially the glutMainLoop, which could be quit only by exiting application made me decide to seek other approaches.GLUT is an odd (and old) window management system, but unfortunately for me, that is how I learned to use OpenGL
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
I can understand what you mean, particularly from the programming examples you have in thinBasic and in the bonus packs. I can discard GLUT... I simply need to think differently
My true interests in graphical programming are the visualization of mathematical objects (fractals, curves, surfaces... functional, implicit, and parametric, Riemann, etc.) and physics simulations. Your physics examples are fantastic and that is another area that I'm noting for further exploration.
Very nice work... and I have SO much to learn!
Stan
Bookmarks