glbasic, or ...?

Previous topic - Next topic

shaftusmaximus

Hi,

My background is that I'm an experienced developer with an engineering degree, used to work for IBM, yadda yadda.

At any rate, I've been pursuing my own personal projects, and now have need of some 2D/3D graphics.  Normally I would never choose Basic for a language, but my FIRST CRITERIA is that I want to get graphics up as quickly and painlessly as possible, without a lot of BS.  The less lines of code I have to write to get graphics up and going, and the more intuitive it is, the better for me.  I could sit down and start writing in openGL (been there, done that), but if there is something out there that can get me up and running A LOT QUICKER, that's what I'm looking for.

I'm NOT looking for something that essentially lets me write the same exact opengl code in Basic.  If what I end up writing is a line by line translation of opengl (vertex commands and the whole tedious 9 yards), I can just use opengl.  What I'd like is a few lines of code that gets stuff up and running quick.  For instance, I saw maybe 3 or 4 lines of darkbasic code that had a rotating 3d cube on the screen.  That's the kind of thing I'm looking for.  I'd like minimal code and time leading to maximum results on screen.

Would you recommend glbasic for my needs?  If not, what would you recommend?

Thanks a lot.

PeeJay

Er, this must be a trick question! Obviously, GL Basics users on a GL Basic forum are going to recommend GL Basic!

However, in answer to your question, yes, GL Basic will allow you to get graphics up and running quickly, and, speaking for myself, having come from Blitz Basic (and, in turn, before that I used Dark Basic) I have found that GL Basic offers eveything you need, and since it compiles to C, it runs quickly on low end machines (or in comparison to what I have used in the past)

Of course, any high end language does have limitations (I am basing this on my background as a Sinclair Basic / Z80 assembler coder) - I feel sure that coding in Open GL could achieve more than using GL Basic - but I have yet to find anything I have wanted to do that GL Basic can't handle.
www.peejays-remakes.co.uk
For games, remakes, and GL Basic Tutorials
Artificial Intelligence is no match for Natural Stupidity

Quentin

just as Peejay said. Nearly everyone in this forum will recommend GLBasic for your purposes.
Here's just a small example on how to show a rotating 3D cube on the screen. As far as I know, DarkBasic has some buildin functions for creating 3D primitives like cubes, spheres, cylinders .... In GLBasic they are not build in, but are delivered as samples and can be used as easily as in DarkBasic.
Some other facts:

  • you can also use OpenGL calls, there is a wrapper for nearly all OpenGL functions
  • you can create and save 3D objects (save and load them in GLBasics own format

Code (glbasic) Select

angle = 0                       // angle for rotation
cube = GENX_OBJ()               // get a free handler for a 3D object
CreateCube(cube, 3, RGB(200, 200, 200))

WHILE TRUE
X_MAKE3D .1, 1000, 45       // switch to 3D mode
X_CAMERA 0, 3, -10, 0, 0, 0 // set the 3D camera
X_AMBIENT_LT 0, RGB(128, 128, 128)  // set an ambient light
X_ROTATION angle, 1, 1, 1   // rotate the 3D object around all axes
X_DRAWOBJ cube, 0           // finally draw the object
SHOWSCREEN                  // show it on screen
INC angle, 1                // increase the rotation angle
WEND


// ------------------------------------------------------------- //
// -=#  CREATECUBE  #=-
// ------------------------------------------------------------- //
FUNCTION CreateCube: num, sz, col
// Diese Variablen sind als LOCAL definiert:
// num, sz,
X_AUTONORMALS 1 // For a cube, hard edges
sz=sz/2
X_OBJSTART num
// Front Face
X_OBJADDVERTEX  sz, -sz,  sz, 1, 0, col
X_OBJADDVERTEX -sz, -sz,  sz, 0, 0, col
X_OBJADDVERTEX  sz,  sz,  sz, 1, 1, col
X_OBJADDVERTEX -sz,  sz,  sz, 0, 1, col
X_OBJNEWGROUP
// Back Face
X_OBJADDVERTEX -sz,  sz, -sz, 1, 1, col
X_OBJADDVERTEX -sz, -sz, -sz, 1, 0, col
X_OBJADDVERTEX  sz,  sz, -sz, 0, 1, col
X_OBJADDVERTEX  sz, -sz, -sz, 0, 0, col
X_OBJNEWGROUP
// Top Face
X_OBJADDVERTEX -sz,  sz,  sz, 0, 0, col
X_OBJADDVERTEX -sz,  sz, -sz, 0, 1, col
X_OBJADDVERTEX  sz,  sz,  sz, 1, 0, col
X_OBJADDVERTEX  sz,  sz, -sz, 1, 1, col
X_OBJNEWGROUP
// Bottom Face
X_OBJADDVERTEX  sz, -sz, -sz, 0, 1, col
X_OBJADDVERTEX -sz, -sz, -sz, 1, 1, col
X_OBJADDVERTEX  sz, -sz,  sz, 0, 0, col
X_OBJADDVERTEX -sz, -sz,  sz, 1, 0, col
X_OBJNEWGROUP
// Right face
X_OBJADDVERTEX  sz,  sz, -sz, 1, 1, col
X_OBJADDVERTEX  sz, -sz, -sz, 1, 0, col
X_OBJADDVERTEX  sz,  sz,  sz, 0, 1, col
X_OBJADDVERTEX  sz, -sz,  sz, 0, 0, col
X_OBJNEWGROUP
// Left Face
X_OBJADDVERTEX -sz, -sz,  sz, 1, 0, col
X_OBJADDVERTEX -sz, -sz, -sz, 0, 0, col
X_OBJADDVERTEX -sz,  sz,  sz, 1, 1, col
X_OBJADDVERTEX -sz,  sz, -sz, 0, 1, col
X_OBJNEWGROUP
X_OBJEND

ENDFUNCTION // sz

Moru

Hello!

I'm no 3D expert but this is what I do to get some 3D result on screen, using the entity layer that you can find elsewhere on the forum. Something is wrong with my coordinates but I just woke up and need to leave now :-)

Code (glbasic) Select

SETSCREEN 800,600, FALSE
LOCAL sand, cam, light, box
sand = EntityLoadTexture("img/snowflakes.png")  // Load a texture and put ID in "sand"
cam = EntityCreateCamera()  // Gets us a camera with the entity ID in "cam"
EntitySetPosition(cam, 0, -10, -2)
light = EntityCreateLight(RGB(255,255,255))
EntityMove(light, -150, 150, 150)
box = EntityCreateCuboid(1, 1, 1)  // Gets us a cube
EntityApplyTexture(box, sand, -1)

WHILE TRUE
EntitySetRotation(box, 5, 10, 15)  // Rotate around local axis 5, 10 and 15 degrees respectively
EntityDrawSystem()
SHOWSCREEN
WEND


Edit: Quentin was faster :-)

shaftusmaximus

Quote from: PeeJay on 2009-Aug-09
Er, this must be a trick question! Obviously, GL Basics users on a GL Basic forum are going to recommend GL Basic!

Ha!  Yeah, I actually thought the same thing when posting the question, i.e. "what do I expect these people to say?", however, I really had no other practical alternative except to ask the question, and ask it here on this forum, and I could always pray for someone to give an honest appraisal of the situation, i.e. "glbasic is fantastic, however for your needs you might want to look at product X."

I'm sure glbasic is great.  I'll keep checking back here for more responses, while continuing to research on my own what the best thing would be.

9940

After some months of glbasic programming I came to this conclusion: since glbasic become a c++ translation,
why don't use a big namespace with all glbasic commands for 2D/3D/Souds etc. with all benefits of c++ programming ?
This because a seriously big project written in basic become difficulty to manage.
However if you have in mind to write something which don't needs a team glbasic is a great idea (and you can port your
project to other platforms with a click).

MikeHart

I personally would not judge a 3d oriented programming language by how easy it is to show off a spinning cube. In a real application you have to have more features involved.

Personally I own a license to all the relevant 3D/game related basic languages (besides GLBasic which I am evaluating now) and know thrm pretty damn good. DarkBasic and Blitz3D. I also own BlitzMax, got PureBasic long time ago. I am also heavily involved in the thinBasic development.

I think an entity system like Blitz3D, thinBasic and GLBasic features is virtual to make 3D programming easily. You setup your objects/models, transform them when you need and with one command you render them. I'm glad to see that GLBasic has an extension for this. Blitz3D was my first love because of that but sadly its development stopped. thinBasic is actively developed but some people don't like interpreter languages. I don't have enough experience with GLBasic to fully judge it but on the paper its looks powerful enough to create a decent game/3D application.

Michael

shaftusmaximus

Quote from: MikeHart on 2009-Aug-09
I personally would not judge a 3d oriented programming language by how easy it is to show off a spinning cube.

No judgments were made, other than the judgment of "the less lines of code and complexity involved to get these kinds of graphics up and running, the better."

I like what I'm hearing so far.  I hope to read more comments here.

Thanks.

MrTAToad

#8
I like the 3D part of GLBasic - its unusually in the fact that no indices are used - unlike, say, DBPro.

GLBasic doesn't have primitives built in, but the code to create basic ones is provided.

The only thing would be to experiment with the demo.

You might be interested in :

http://www.youtube.com/watch?v=E40BhwvH-Qo

Hemlos

Hi!
Yes, im a moderator, and perhaps my opinion is too biased for you.
However, let me input a few observations about GLBasic.

From what i understand, GLBasic can export to more OS's than any of the other language.
These platforms include a slew of handheld machines, windows, linux, apple, gp2x, and more.

And as of recently, you will be able to include windows apis with headers very easily with an import command for the functions in question. This means, windows style menuing and listing is possible, or even your own private libraries.

As for 3d...alot of people here have been working on different projects, which you can include into your 3d.
For instance:
A 3d entity system
A load of 3d object primitives, ready to rock, which are included in the samples directory( and on this website)
There is also a 3d math library on this website.
And im almost finished with a fully operation particle system API for 2d and 3d.
I also have a program i posted, which will take a 2d image and from the pixels in a bitmap, create a full color object.

And something i value the most of all, the user skills base in the forums, of whom will jump at any opportunity to help anyone with questions about anything.

Oh yea, another useful thing, you can produce binaries and formats for anything imaginable.
For example, i made a program that can produce midi files.








Bing ChatGpt is pretty smart :O

shaftusmaximus

Thanks for the replies - really helpful.  Looks like a great product and great community.  I'll try it.