QB64 Phoenix Edition
Wireframe animation - Printable Version

+- QB64 Phoenix Edition (https://qb64phoenix.com/forum)
+-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1)
+--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3)
+---- Forum: Programs (https://qb64phoenix.com/forum/forumdisplay.php?fid=7)
+---- Thread: Wireframe animation (/showthread.php?tid=3855)



Wireframe animation - SquirrelMonkey - 08-09-2025

Code: (Select All)
Screen _NewImage(1920, 1080, 256): centerX = 1920 / 2: horizonY = 520
Const roadWidth = 1920: Const maxZ = 50: Type LinePoint: z As Single: y As Single: End Type
Dim lines(maxZ) As LinePoint: For i = 0 To maxZ: lines(i).z = i + .1: Next
Do: Cls: For i = 0 To maxZ: z = lines(i).z: scale = 1024 / z: y = horizonY + scale
        Line (centerX - roadWidth * scale / 2, y + 1)-(centerX + roadWidth * scale / 2, y + 1), 11
        Line (centerX - roadWidth * scale / 2, y)-(centerX + roadWidth * scale / 2, y), 3
        Line (centerX - roadWidth * scale / 2, horizonY - (y - horizonY) + 40)-(centerX + roadWidth * scale / 2, horizonY - (y - horizonY) + 40), 5
        lines(i).z = lines(i).z - 0.1: If lines(i).z < 1 Then lines(i).z = maxZ
        Next: For x = -90 + r To 90 + r: px = x / 10! * roadWidth / 640
        x1 = centerX + px * (1080 / 1): y1 = horizonY + (1080 / 1): x2 = centerX + px * (1080 / maxZ): y2 = horizonY + (1080 / maxZ)
        Line (x1, y1 + 1)-(x2, y2 + 1), 15: Line (x1, y1)-(x2, y2), 11
Line (0, 1)-(1919, 1079), 11, B: Next: _Display: _Delay 0.016: Loop


[Image: Screenshot-2025-08-09-162919.png]


RE: Wireframe animation - Unseen Machine - 08-10-2025

I can see a TRON game in the works!

Nice

Unseen


RE: Wireframe animation - SquirrelMonkey - 08-10-2025

(08-10-2025, 04:55 PM)Unseen Machine Wrote: I can see a TRON game in the works!

Nice

Unseen
Thanks. I turned it into a car game, but it sucks, haha.


RE: Wireframe animation - Unseen Machine - 08-10-2025

Nothing good comes easy! Keep trying and I'm sure it'll be worthwhile.

My only notes are your code is not very readable, has ZERO comments and you seem to be using scale / 2 a lot, consider using a Half_Scale value or some instead to avoid the repeated math operations.

On a side note, never think your code sucks. it might not be as other would do it, as you wanted it or not as efficient as it could be but YOU made it! Be proud and keep attacking it!

Unseen


RE: Wireframe animation - TempodiBasic - 08-10-2025

@SquirrellMonkey
Cool
it is at the basis of Blaster Arcade!
take a look here blaster arcade expecially at 1.46 in Robot grid