Jump to content

[Blitz3D] My very first Physics Engine middleware, written in Blitz3D. Tokamak2010-OpenPhysics-

DoriMatsuriZebra

68747470733a2f2f7777772e626c69747a666f72756d2e64652f67616c6c6572792f696d616765732f3062653437306330306333352e6a7067.jpg.4dfd30ba10031d7a51421f0ee527ca1c.jpg
Tokamak 2010 - Open Physics - A physics middleware extension for Blitz3D.
This is my very first open source project. I learned how to write physics simulations with this project.
Back in 2010 I was about 5 years into my software developer journey.
I found Blitz3D, a successor of AmigaBasic. One of a kind programming language. (It sure does have a very interesting history. Since it originally shipped on a PC magazine back in the day)

You essentially start of from a plank page. So you are able to get seriously creative ..or damage your hardware.

(Seriously that was a possibility back then. Luckly it's now prevented with a MAV error message. In the modern installment of this Basic language)
I had to point this out, because even with the MAV error message, if you do write badly designed code, you may still crash your system.

 

What makes Blitz Basic and Blitz3D special? The fact that it has a early adaption of object oriented porgramming language support. Through structs, that are described as types.
If you are interested, and ready to invest hours of your time into it, you are able to invent your own high level programming language. 
Oh and I almost forgot, it's got a massive DirectX 7 integration! So you get all the amazing DX 7 Graphics, right under the power of your fingertips.
(Jokes aside, its actually good for a beginner or someone who just wants 3D graphics seriously fast!)

300px-Game_Engine_-_Blitz3D.png.294e1112189d9f8aca6f4b8ec8346889.png

But what its also great for, is to write quick program conceptions. And learn programming in general. With a great understanding of realistic risks of it. One thing you will instantly notice, is that the file size is next to nothing.

Only your media (textures, models and audio files) are directly responsible of the final project size. But be aware, you now need to deal with manual backups. So expect to lose some code at some point.

This is what this project is. A stage of my software development journey, where I switched over to learning more advanced languages, such as C++ and .NET platform (Java I guess?)
Anyway, if you want to mess around with a free physics engine. Just to stress test the machine for example. Then tat is totally doable.
In fact I used it to see how much physics I am able to simulate with my machines.
It really was a interesting time back then. Physics engines came out from left and right. Novodex, ODE, Tokamak. They were the ones setting the ground. And PhysX was right around the corner.
Which is the main physics engine that I am now working with in daily basis.

 

But other than that, the code setup is mostly the same, all around the spectrum, with this basic language.
This is the first example.bb file in my "entry" project to the open source field.
 

Graphics3D 1280, 1024, 32, 2 
SetBuffer BackBuffer()
Include "PostProcess.bb"
AppTitle "Glow like Seyhajin" 
ClearTextureFilters

amb#=60
AmbientLight amb#,amb#,amb#

center        =    CreatePivot()
; -- !! Camera
Cam        =    CreateCamera()
                PositionEntity cam,0,0,-5
    initglow(Cam)
    fade#=0
    dark_passes=2
    glow_passes=3
    glare_size#=4
; -- !! lights
light2        =    CreateLight()
                PositionEntity light2,-38,10,-38                
; -- !! mesh
teapot        =    LoadMesh("teapot.x")            
tex            =    LoadTexture("spheremap.bmp",64)    
                EntityTexture teapot,tex
        
;main loop!
While Not KeyDown(1)
    TurnEntity teapot,0,1,.5
    PointEntity light2, center

    renderglow(fade#,dark_passes,glow_passes,glare_size#,255,255,100)
    UpdateWorld        
    RenderWorld 
    Color 155,255,200
    Text 20,20, "Glow like Seyhajin"
    Flip 1
    Wend 
End

ALSO. A good reminder, since this programming language does not have a integrated garbage collector, you have to free resources manually, by using "FreeEntity" or relative command to free textures. The documentation is included in the editor. so you are able to look it up, even offline!

Otherwise, you will load everything to your ram, and it stays there, until you restart your system (free the ram) So now you know!


Here's the link to the GitHub repo:
https://github.com/AuthenticFounder/Tokamak2010-OpenPhysics-
Just get yourself the Blitz3D.

Extract the archive somewhere.
Navigate to the Blitz3D installment folder.

Paste the "userlib" folder contents to the folder named by the same way, located in Blitz3D.
And you should be ready to go.
Open up one of the example in B3D and hit the rocket button (rocket science .. bruh)

 

In fact I still mess around with Blitz3D today, since it's now free and even open source if you really like it.

I even wrote a semi working VDE (Visual Development Environment) resulting in a modern game engine look.
By semi working I mean, that you literally have to assign every win32 API manually. That is extremely a lot of work, when you are trying to think in two ways of writing it. One is object oriented and the other is ...well basic. LOL
But what I learned from this process is, that now I am able to track down some major memory leaks, quite easily, since I have the understanding of "enrolled" code and how the OOP navigates in it. This is something that modern interpreters and scripting languages sometimes confuse me.

Anyway here's something late I have been working with my B3D code as a hobby. To show that it's not the ride, its the driver who makes the difference.
Ofc its still not comparable to a modern visual fidelity, But it follows the IBL rules. In fact Crashday was also utilizing the Direct X 7 Graphics framework.
And I must point this out, there is 0 shaders rendering this scene. Just textures and lighting math.
prlBq4.thumb.jpg.7ac28e9b334812c2afa966787edc53da.jpg


 

Best Regards,
Ravel

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×