English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 02 December 2021, 10:44   #1
crf45
Registered User

 
Join Date: Nov 2021
Location: Mauritius
Posts: 5
How is 3D 3.456 dots possible on Amiga 500?

I used to program a few demo on A500 in the 90s and there are several tricks I'd like to understand. For example 3.456 dots 50FPS on A500 with shape that change made by Hannibal on Anarchy's 3D Demo 2. Do you have some pointers on how this is possible? at 2:52 [ Show youtube player ]

I asked this question here as well with interesting answers but no concrete code ,trick or algorithm.
https://www.reddit.com/r/amiga/comme..._on_amiga_500/
crf45 is offline  
Old 02 December 2021, 11:14   #2
grond
Registered User

 
Join Date: Jun 2015
Location: Germany
Posts: 1,152
They probably use cylindrical coordinates for the landscape dots and tables for projection on the screen. That's why the landscape can rotate easily, that's just one addition for the angle-offset. I assume there is no perspective in the z-direction, then the height info of the dot directly translates to the screen. Similarly the sphere and cube are probably done using spherical coordinates. Again only some adds needed for the two angles of rotation, tables for projection.
grond is offline  
Old 02 December 2021, 11:36   #3
a/b
Registered User

 
Join Date: Jun 2016
Location: europe
Posts: 573
- no depth/perspective (parallel perspective, meaning z is ignored for speed but it will look 2D/flat-ish)
- 4x mirroring/symmetry, and thanks to no perspective maybe the entire thing is just only x and y, and lots of tables (entirely fake 3D)
- morph is very limited: only dots that are part of a group of e.g. 64 dots can morph between eachother, and every group morphs in the same way (probably precalc and then use a set of tables to scale to appropriate size in real-time)
- don't know whether it's a 3-axis rotation or maybe simplified as 2-axis, or entirely faked in some other way (because of the above)
The point being, it's not entirely what it appears to be .
a/b is offline  
Old 03 December 2021, 12:36   #4
crf45
Registered User

 
Join Date: Nov 2021
Location: Mauritius
Posts: 5
The thing is that I remember having done a 2048 dots sphere with all coordinate precomputed and only 5 simple instructions (no mul/div) to get each dot coordinate and print it on bitmap, this is why I am wondering how this is possible? One day I will take the time to decompile it 100%
crf45 is offline  
Old 03 December 2021, 13:01   #5
grond
Registered User

 
Join Date: Jun 2015
Location: Germany
Posts: 1,152
You don't happen to have that code anymore?
grond is offline  
Old 03 December 2021, 13:34   #6
chb
Registered User

 
Join Date: Dec 2014
Location: germany
Posts: 341
Rock Lobster by Oxyron has a pretty impressive dot routine and the source is on github. From the doc:
Quote:
Vectorplots:

One of the technical hi-lights in the demo.
2816 z-shaded morphing vectorplots. Before adding sprite-overlays and design-stuff I had 3172.
A transformation matrix is generated every frame.
The morphing is just the result of using lots of prescaled sintables.
Half of the pixels are transformed with one add.l for X, Y & Z.
Then the blitter extracts the bits and adresses for the plots including z-shading.
The blitter also mirrors the bits, adresses and shading for the other half of the symmetric object.
The CPU sets the pixels with a bset.b per pixel.
Might be worth a look.
chb is offline  
Old 14 December 2021, 18:24   #7
zero
Registered User

 
Join Date: Jun 2016
Location: UK
Posts: 401
The blitter is a very powerful tool for accelerating these kinds of bit handling functions that the 68k is bad at. It's also pretty complex to get it to do what you want, really need to wrap your brain around how it works.
zero is offline  
Old 17 January 2022, 04:08   #8
ImmortalA1000
Registered User
 
Join Date: Feb 2009
Location: london/england
Posts: 459
Starfield at 3.55 is nice. Problem was demo coders never made kick-ass game engines in my time with Amiga so I was always suspicious by default otherwise it would be more than just a demo segment
ImmortalA1000 is offline  
Old 23 January 2022, 05:47   #9
Hannibal
Registered User

 
Join Date: May 2015
Location: Kirkland, Washington, USA
Posts: 33
So i don’t remember all the details, but I remember that it did 4 dots at a time, in 14 instructions. It was based on symmetric dots within a slice, and on the slices being symmetric too. - so when it drew a dot in a slice, it also drew the opposite dot in the same slice, and those two dots in the opposite slice. I believe it was loop unrolled for a full slice, and used self modifying code to store a rotated x/y values for each dot in the slice (and all slices look the same. So I think the only math that happened per 4 dots was to scale the x/y for that slice (a lookup table), add and subtract the x/y for the center of the slice - the rest was bit manipulation and bsets

Also, all credit where due, I saw a very similar technique in another demo before, it just didn’t have anywhere near as many dots.

And complex did a version with 4096 dots with a super clever trick - they just calculated the X/Y coordinates and stored them in a list, and had the blitter build a list of bset commands, which the cpu then executed. Since the bit manipulation was the most expensive part of dot routines, this was worth the complexity of having multiple steps
Hannibal is offline  
Old 23 January 2022, 14:02   #10
chb
Registered User

 
Join Date: Dec 2014
Location: germany
Posts: 341
Quote:
Originally Posted by Hannibal View Post
And complex did a version with 4096 dots with a super clever trick - they just calculated the X/Y coordinates and stored them in a list, and had the blitter build a list of bset commands, which the cpu then executed. Since the bit manipulation was the most expensive part of dot routines, this was worth the complexity of having multiple steps
Ah, I guess you are referring to the "A500 Homage" 40k?
https://www.pouet.net/prod.php?which=9268

There's some amazing code in that one indeed... (and great music and a nice design).
chb is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Amiga 500 Rev.6A VS Amiga 500 Plus with 2MB chip and ACA 500 turrican9 support.Hardware 0 24 December 2016 03:16
Little dots over WB 4.1 screen Leandro Jardim support.WinUAE 2 18 July 2016 23:46
Icons showing up as dots - anyway to fix? mfletcher support.Apps 17 08 July 2012 03:39
Hot Dots! h0ffman Amiga scene 1 01 May 2012 15:46
Missing dots in HGFX Ratte support.WinUAE 6 19 January 2009 12:09

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 10:43.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.
Page generated in 0.11741 seconds with 15 queries