|
Post by Roger Cabo on Feb 8, 2020 2:52:51 GMT 1
Hi, long time ago I wrote this small demo. Particle influence in real-time while click on the screen.
* On the top left you see a small horizontal menu. Use left and right mouse button to change the values.
* With some better understanding of memory layout and how CPU caching works, you can fasten up this demo a lot. Values are stored in a memory layout (Array) can be accessed very fast if the CPU does not leave the L1 or L2 cache. This demo does NOT use the memory layout enhancement.
* If you have some experience with math graphics, I would love to see some new geometrics. The base idea is very simple. Fill an the pixel x,y array with positions, and with next direction where a pixel has to move.
* This is also available in 3D and a complete but unfinished menu. The 3D version works so far, but my acknowledge of windows memory management was not that great at this time. Sometime after 100 starts it crash for any unknown reasons.
!!! GB32 Source Code Link available !!!
|
|
|
Post by Roger Cabo on Feb 8, 2020 3:18:01 GMT 1
Screens Attachments:
|
|
|
Post by Roger Cabo on Feb 8, 2020 3:18:38 GMT 1
Screens Attachments:
|
|
|
Post by Roger Cabo on Feb 8, 2020 3:32:08 GMT 1
The link to the small gb32 source code for the 2D Program:
www.cabo.de/check/gb32/relatimedemov13.zip
Here is a simple try to generate new particle positions. With a bit of math you can project the direction vectors and store them into the directions of the main program. Relatimedemov13.zip you can download from the link above.
Const WindowWidth = 1024, WindowHeight = 1024 'taille fenĂȘtre Const CenterX = WindowWidth / 2, CenterY = WindowHeight / 2 'centre fenĂȘtre Form Center Fixed fen = " Cool Fractals with GFA-BASIC ", 0, 0, WindowWidth, WindowHeight .BackColor = 0
Ocx Command btn = "CLEAR", WindowWidth - 75, WindowHeight - 65, 50, 25 Ocx Timer temp .Interval = 1000 .Enabled = True
Do Sleep Until Me Is Nothing
Sub temp_Timer DrawPoints EndSub
Sub btn_Click Cls EndSub
Sub fen_Destroy temp.Enabled = False Me.Close End ' of program EndSub
Proc DrawPoints Local Integer col, dots, i Local Single a, b, c, x, y, j, z, xp, yp ' random colors col = RGB(Rnd() * 256, Rnd() * 256, Rnd() * 256) ' random starting positions a = Rnd() b = 0.9998 c = 2 - 2 * a dots = 12000 x = j = 0 y = Rnd() * 12 + 0.1 ' calculate and draw the points For i = 0 To dots z = x x = b * y + j j = a * x + c * (x ^ 2) / (1 + x ^ 2) y = j - z xp = x * 20 + CenterX yp = y * 20 + CenterY Pset xp, yp, col Next EndProc
|
|
|
Post by Roger Cabo on Feb 8, 2020 18:20:54 GMT 1
Realtime Elements 3D Demo V48There is a lot of stuff implemented. It can run full screen in about 100 fps. If you have any questions about. Please ask.
# I link the gb32 code later
Attachments:
|
|
|
Post by Roger Cabo on Feb 18, 2020 0:11:44 GMT 1
Hi everyone,
here is the 2D and 3D version of RealtimeElements.
+ Please copy your GB32 version into the folder of RealtimeElements. + Start gb32 from there, and load the .g32 file and start. Otherwise it will not work, because the project folders are not found.
Have fun!
Tips:
+ In the year 2000 I never hear about bilinear or BiCubic sampling. But I thought about a solution to move a picture not by pixels, because on slow speed it jumps from one to the next pixel. So I experimented with a solution to move and Image and a single point by 10th of a pixel. And it worked! Use the different particle picture forms. Beside Blur On/Off.
+ At first you should set the working screen to 1600x1000 pixel, if you own a HD monitor with 1980x1080
www.cabo.de/check/gb32/01.jpg
+ When select [REAL SIZE] , you get automatically into the another editor fullscreen window. + Double Click on the preview slots to load. + Click on the to change colors or set gradient automatically. + Beside Blur On/Off you can set the particle size and form, and also a glimmer effect.
www.cabo.de/check/gb32/02.jpg
If you previously have selected 3D Mode, use the following keys:
3D Mode A - Look Up Y - Look Down S - Look Left X - Look Right F - Camera Field of view + V - Camera Field of view -
R - Repeat the last blast
Space - Blast Right Mouse - Look Around Left Mouse - Blast
It's a bit hard to move inside this 3D Room. Normaly when selecting RMB then a Holodeck 3d Grid should appear.
With the small toolbar I think its possible to save Camera sets. You should try a bit. Further it's possible to place the camera with a click on the arrows.
2D Mode !!! Right Mouse - Cause Stop GB32 - Object is nothing error. (I tried to access the 3D objects from the toolbar, but in 2d it's not loaded ) Left mouse - Draw a cropping area, particles can't move outside.
Top menu Slider - Set the time Speed. For sure you can let run the particles backward. A - Stop/Go All M - Stop/Go Movement G - Stop/Go Gravitation
For example, you can stop the gravitation, but in this case you cannot stop the movement. There is a simple dependency on the buttons. Space - Stop and Go particles R - Repeat last blast
Save BMP as 256 color image. Save AVI ? Does that work? :_D
Download Link: www.cabo.de/check/gb32/RealtimeElementsV13.zip
|
|
|
Post by Roger Cabo on Feb 23, 2020 17:23:48 GMT 1
Wow! That's a lot of code!
It is interesting how you are practically building an avi file by hand. (no API)
Massive project! Well done!
Thank you :-)
This project is not very structured.. It's a try, instead of a real project.
I done already a real professional project with gb32, contains about 60.000 lines of code with online server access from 16 different cities.
|
|
|
Post by scalion on Mar 3, 2020 10:57:33 GMT 1
Hi all, Thank you for all of your support messages when I was down. It was a great pleasure. Wow wow !!!! This demo is just fabulous ! Writing avi work fine ! Very interesting and splendid work ! I remember the old demo Element I was completely blown away but this is downright crazy!
Try use IsNothing() function to prevent error message. Under windows there's the recurent problem of directory security (read only), i think it's better to set the AppDir$ with app.path instead progname who match the gfabasic directory and generate occasionaly an error, then prevent this broblem.
Same thing with the Iam$ variable, but in this case if it's a simple init file it prefered to use registry with GetSetting() and SaveSetting() functions.
EDIT : So I wanted to make my little particle simulator too. I used opengl for the display. It's just fun, take a look :
|
|
|
Post by Roger Cabo on Aug 5, 2022 19:31:22 GMT 1
Today I have a tiny update made to the real time particle demo. + Up to 150000 particles + Framerate up to 240 At about 120000 particles I got 120fps. That's CPU power at 2022 with a AMD Ryzen 9 5900X. ElementsDemoV14.rar (8.18 KB)
|
|
|
Post by ventilo25 on Aug 6, 2022 14:17:12 GMT 1
Magnifiques visions cosmiques que je n'avais pas encore vues et ce n'est pas du chorizo !
Beautiful cosmic visions that I had not seen yet and it is not chorizo!
|
|
|
Post by (X) on Aug 7, 2022 13:00:58 GMT 1
|
|
|
Post by (X) on Aug 7, 2022 13:13:50 GMT 1
Today I have a tiny update made to the real time particle demo. + Up to 150000 particles + Framerate up to 240
At about 120000 particles I got 120fps. That's CPU power at 2022 with a AMD Ryzen 9 5900X.
This demo is brilliant!
It shows the power and speed of drawing to the screen using DIBs and 8 Bit color reference table. And lets not forget the oTimer of millisecond precision.
Nicely done!
Scalion has similar demos that are worth checking out. He's a bit of a pixel magician...
|
|
|
Post by (X) on Aug 7, 2022 13:26:30 GMT 1
Today I have a tiny update made to the real time particle demo. + Up to 150000 particles + Framerate up to 240
At about 120000 particles I got 120fps. That's CPU power at 2022 with a AMD Ryzen 9 5900X.
I had to look it up...
NOICE!
|
|
|
Post by Roger Cabo on Oct 20, 2022 15:25:11 GMT 1
Hi all, Thank you for all of your support messages when I was down. It was a great pleasure. Wow wow !!!! This demo is just fabulous ! Writing avi work fine ! Very interesting and splendid work ! I remember the old demo Element I was completely blown away but this is downright crazy!
Try use IsNothing() function to prevent error message. Under windows there's the recurent problem of directory security (read only), i think it's better to set the AppDir$ with app.path instead progname who match the gfabasic directory and generate occasionaly an error, then prevent this broblem.
Same thing with the Iam$ variable, but in this case if it's a simple init file it prefered to use registry with GetSetting() and SaveSetting() functions.
EDIT : So I wanted to make my little particle simulator too. I used opengl for the display. It's just fun, take a look :
Today I played again with your demo!
|
|