PERSPECT.BAS - GW-BASIC, Perspective drawing using geometry measures

PERSPECT.BAS - GW-BASIC, Perspective drawing using geometry measures

Subscribers:
831
Published on ● Video Link: https://www.youtube.com/watch?v=Yh5mcXAngVc



Duration: 1:29
150 views
1


Before I discovered / invented the way to change 3D data into 2D data, I only knew about this drawing trick to draw perspective: draw two lines into the vanishing point, draw a horizontal line, now choose an angle and keep this angle constant. From one intersection of the horizontal line with one of the vanishing point lines, "draw" (imagine, but don't actually draw) a line with your angle through it, and mark where it collides with the other vanishing point line; this is the place for the new horizontal line. Repeat with this horizontal line. I only realized years later why this works: it's because the angled lines are all actually a single straight line (move them horizontally until they all match up). In a proper perspective drawing, all lines are straight, so you are essentially drawing a diagonal line through grid squares.

This program doesn't show the diagonal lines, but does the math. This is likely my very first program ever that did true perspective.

This is running under PC-BASIC emulator.


My playlists:
--------------------
- Voxel: https://youtu.be/watch?v=XCVWEuhCCDM&list=PLjnbT4UISq0bQF1g85tE9jTrKfEtdRYlY
- Road: https://youtu.be/watch?v=ck5ALX11YU4&list=PLjnbT4UISq0bnfd1RC3M4PgTgkmhlkikV
- Ray Casting 3D: https://youtu.be/watch?v=zjswXUTMP2o&list=PLjnbT4UISq0YcFtRFjFQqK0g6ONNCtrvY
- Side-Scroll Shmup: https://youtu.be/watch?v=fF4X8zN-Raw&list=PLjnbT4UISq0Y_7IAN_zUzxgZnfhXxo_0Q
- MonoGame Tutorial: https://youtube.com/watch?v=WW1dJnfXWb0&list=PLjnbT4UISq0adw__Y9B2eXA0LL35TyORU

My websites:
---------------------
- my GitHub: https://github.com/JDoucette
- my company: http://xona.com
- my Blog: http://thefirstpixel.com