Page 3 of 8
Re: Talent 3D Designer
Posted: Tue Sep 03, 2024 9:28 am
by dilwyn
FrancoisLanciault wrote: Tue Sep 03, 2024 5:44 am
I might go back to it one day, but this time using quaternion instead of sin/cos.
Francois
Had a look at quaternions on Wikipedia. Didn't even understand the English there before I started looking at the maths! So I quickly decided to bail out and leave that part to Francois...
Re: Talent 3D Designer
Posted: Tue Sep 03, 2024 12:26 pm
by Derek_Stewart
Hi
Quaternions are an extension of Complex number that can be applied to 3D Graphics.
But can get a little abstract, I found using a matrix to present 3F Space easier to manipulate than using complex number calculations.
It all depends on what you like and understand.
Re: Talent 3D Designer
Posted: Mon Sep 16, 2024 3:55 pm
by polka
HI !
I showed here some time ago :
viewtopic.php?f=3&t=3238&p=33721&hilit= ... ive#p33721
a way to code TRUE perspective tranform (not plain axonometric) without any trigonometry, thus even possible only with integer arithmetics. Here an example of the result :

- rotating around Z axis
- Avion.gif (127.42 KiB) Viewed 3991 times
I did this with the following algorithm (method) that I invented to be used with 16 bits arithmetic operations ( + - * / ) of usual FORTH machines :
Following source code for the Digital Precision SupperFORTH, that is PD :
More details in the other posts of the given thread, including speed comparison of Computer One FORTH with SupperFORTH using this same algorithm.
Re: Talent 3D Designer
Posted: Mon Sep 16, 2024 8:47 pm
by NormanDunbar
Impressive!
I'm wondering how fast in relation to actual speed, is that GIF?
Cheers,
Norm.
Re: Talent 3D Designer
Posted: Mon Sep 16, 2024 10:57 pm
by stevepoole
Hi Polka,
Pleasing animation.
If I could see the data x,y & z coordinates, it would be a simple affair to reproduce the output in Superbasic, using trigonometry, to compare the two methods.
As there are not many data points, the result should run very fast.
With SMSQ/E, you should be able to write your method using integer% variables....
__________________________________
Re: Talent 3D Designer
Posted: Tue Sep 17, 2024 9:50 am
by polka
Hi !
At the end of the PERSPECTIVE.FTH source file you have three MESH type words that contain the data for a SQUARE , a CUBE and an AVION (the airplane). These data words are compiled by the four words compiled just before : MESH , C , X , and END-MESH.
the MESH word creates a mesh data structure for 3D point coordinates and connections between points.
for adding a 3D point you give 3 numbers ( x , y , z ) and call C.
when all points are loaded, you add the connections by their number with the word X (positive to draw a line and negative to go to the next point pen up).
when finished, you call END-MESH.
the AVION connection data was compacted by the word XA that will just after the first connection -1 X automatically loop from point 2 to point 15 and then continues with 9 X 16 X etc.
You should be able to retrieve the data you need from this source file.
BYE !
Re: Talent 3D Designer
Posted: Tue Sep 17, 2024 5:49 pm
by polka
NormanDunbar wrote: Mon Sep 16, 2024 8:47 pm
Impressive!
I'm wondering how fast in relation to actual speed, is that GIF?
Cheers,
Norm.
In the old thread that I showed the link above, beginning page 3, I measured the speed, comparing the same program running under ComputerOne FORTH and Digital Precision SupperFORTH. On a BBQL with 128k, 1 picture of the airplane is plotted in 0.8s with ComputerOne FORTH, but with SupperFORTH it takes 2.4s. On emulators with Minerva ROM letting 2 screens alternate, it should display as fast as my GIF, maybe even faster.
Anyway, I am sure that my method is faster than the classic method, because it does not use trigonometry nor floating point, only 16bit integers operations, not counting it was coded with FORTH which is almost as fast as assembler (say ComputerOne FORTH, SupperFORTH seems a lot slower, and I suspect I know why).
Re: Talent 3D Designer
Posted: Tue Sep 17, 2024 8:31 pm
by NormanDunbar
Much obliged. Thank you.
I'm not a Forth programmer I'm afraid, but I would imagine that 16 bit integers would be decades faster than floating point.
Cheers,
Norm.
Re: Talent 3D Designer
Posted: Wed Sep 18, 2024 9:00 am
by polka
To make a point on my method compared with the classic (trigonometric) method :
In both, you have to consider the object (or scene) reference and the camera reference.
In the classic method you compute a 3D rotation of the scene to become parallel to the camera reference ; by multiplying 3 elementary rotations with sines and cosines. When there, you get a matrix for axonometric perspective. Then you compose with another matrix to introduce an "affix" transform, for magnifying the nearer points and reducing the farther. This transform depends on the distance between the scene reference origin and the camera.
When you have this final tranform matrix you can compute the reduced bidimensional coordinates of all the significant points of the scene, and scale them to plot the wire frame figure.
In my method, you have only to consider the position P of the camera in the scene reference. All the significant points M of the scene remain in their scene coordinates, and the position of the camera has also 3D coordinates in the scene reference.
To compute the images I of the points M you only have to compose the formula given in my paper using 3D scalar and vector products, with only the scene reference coordinates of P and all the M points.
After that you will compute the reduced scaled 2D coordinates of the 3D coordinates of the images I : just by scalar products with two references of the image plane H and V (These were created with the same length and orthogonal to OP by the POINT-OF-VIEW word).
Instead of algorithms to compute floating point sines and cosines and then use floating point operations algorithms to transform the significant points of the scene, my method use no trigo and eventually only the integer machine code operations of the 68008 processor (that are part of the FORTH kernel primitives).
BYE, POLKa
Re: Talent 3D Designer
Posted: Wed Sep 18, 2024 11:40 am
by Derek_Stewart
Hi
I like the Forth language but have limited time to be proficient in it.
I used like using Brouhabouha Forth, would your 3D Forth file work in Brouhabouha?