Welcome, Guest. Please login or register.

Author Topic: Amiga 3D Graphics Programming in BASIC  (Read 278 times)

Description: Book

0 Members and 1 Guest are viewing this topic.

Offline stevmjonTopic starter

Amiga 3D Graphics Programming in BASIC
« on: October 11, 2022, 03:27:14 AM »
hi there

i just wanted to show my efforts of coding what was in the book 'Amiga 3D Graphics Programming in BASIC', 1989.

i actually purchased this book way back in 1989, for use on my Amiga 500. i browsed through the book but didn't find it beginner friendly, so i just shelved it.
over the last few years i have learnt 3D and coded a 3D engine. i actually used a basic language too.
i became interested also in learning ray tracing and thought about this book.

so...thirty years later i have actually studied the book and coded it, and it works.
i did the code in a more modern basic language, so didn't need all the routines from the book (eg. skipped the color range etc, as modern computers are all 32 bit color, and some hardware routines invalid today).
i am glad i did this after all this time passed and thought i would share this 'accomplishment' i didn't understand way back.
i did need to use multiple other books (see pic) to convert the amiga basic language into a different one. lucky i still had all those other books. it took me around 2 months to complete.

just a note, if anybody does own this book and decide to use it, the book had a few minor errors in the code, mainly when they calculated the drawing of the spheres.
they coded using radians and forgot to convert these to degrees when using sin() and cos(). so the spheres where initially squigly lines. easy fix though.

   stevmjon

 

Offline TribbleSmasher

Re: Amiga 3D Graphics Programming in BASIC
« Reply #1 on: October 13, 2022, 04:47:29 PM »
Well done.
I had this in mind too for a couple of decades, but never got to it.
Doing this in AmigaBasic is no fun.
 

Offline stevmjonTopic starter

Re: Amiga 3D Graphics Programming in BASIC
« Reply #2 on: October 14, 2022, 02:11:50 AM »
thanks TribbleSmasher.
i am glad i didn't code this in amiga basic, as there was a lot of code i could skip. using a modern basic language made it a lot easier, so i could focus on the ray tracing routines and the editor routines.

if you are interested in coding a ray tracer, this link has a website where the mathematics are explained in an easy to understand manner (easier than the book here).
https://www.scratchapixel.com/lessons/3d-basic-rendering/minimal-ray-tracer-rendering-simple-shapes/ray-sphere-intersection

the ray tracing routines are actually not that big to code, it's the editor that was most of the code. this editor allows you to add new objects and modify/move them around easily, rather than hard coding them in.
just keep in mind, that there are 2 methods to code in. the first is 'geometry' that i found easy to pick up and learn as it focuses on simpler calculations. the second is 'quadratic' that combines equations together making more efficient routines but a bit more technical to understand. keep this in mind if you watch youtube videos on the subject as users will choose one method or the other.

good luck, stevmjon
 
The following users thanked this post: TribbleSmasher