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...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
Talent 3D Designer
Re: Talent 3D Designer
--
All things QL - https://dilwyn.theqlforum.com
All things QL - https://dilwyn.theqlforum.com
-
- Font of All Knowledge
- Posts: 4610
- Joined: Mon Dec 20, 2010 11:40 am
- Location: Sunny Runcorn, Cheshire, UK
Re: Talent 3D Designer
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.
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.
Regards,
Derek
Derek
Re: Talent 3D Designer
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 : 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.
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 : 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.
May the FORTH be with you !
POLKa
POLKa
- NormanDunbar
- Forum Moderator
- Posts: 2424
- Joined: Tue Dec 14, 2010 9:04 am
- Location: Leeds, West Yorkshire, UK
- Contact:
Re: Talent 3D Designer
Impressive!
I'm wondering how fast in relation to actual speed, is that GIF?
Cheers,
Norm.
I'm wondering how fast in relation to actual speed, is that GIF?
Cheers,
Norm.
Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts
No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
Author of Arduino Software Internals
Author of Arduino Interrupts
No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
-
- Aurora
- Posts: 874
- Joined: Mon Nov 24, 2014 2:03 pm
Re: Talent 3D Designer
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....
__________________________________
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
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 !
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 !
May the FORTH be with you !
POLKa
POLKa
Re: Talent 3D Designer
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.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.
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).
May the FORTH be with you !
POLKa
POLKa
- NormanDunbar
- Forum Moderator
- Posts: 2424
- Joined: Tue Dec 14, 2010 9:04 am
- Location: Leeds, West Yorkshire, UK
- Contact:
Re: Talent 3D Designer
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.
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.
Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts
No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
Author of Arduino Software Internals
Author of Arduino Interrupts
No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
Re: Talent 3D Designer
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
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
May the FORTH be with you !
POLKa
POLKa
-
- Font of All Knowledge
- Posts: 4610
- Joined: Mon Dec 20, 2010 11:40 am
- Location: Sunny Runcorn, Cheshire, UK
Re: Talent 3D Designer
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?
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?
Regards,
Derek
Derek