![]() |
![]() |
#201 |
uber cool demi god
![]() Join Date: Jun 2006
Location: Kent/England
Posts: 2,073
|
My PC is in the living room
![]() I have printed out some tutorials as I would really like to start coding but I know she'll need "entertaining" all of a sudden if I'm doing something. ![]() |
![]() |
![]() |
#202 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Well, if you ever need a hand getting started coding then drop me a note and I'll try to help you out.
![]() |
![]() |
![]() |
#203 | |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Quote:
Taking it that in this case we want to draw all our lines upwards, you have to always make sure that y1 < y2. If not, you have to swap y1 and y2 around to force y1 < y2. Now, *if* you have to swap y1 and y2 around, then you *also* have to swap x1 and x2 around before you draw the line. If no swapping is required you can just draw the line. Additionally, you only need to choose between four of the eight possible line draw octants using this method as there are only four that fall in the upwards direction. Last edited by pmc; 05 March 2010 at 16:56. |
|
![]() |
![]() |
#204 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Et voila - one filled cube.
![]() Last edited by pmc; 03 June 2010 at 09:01. |
![]() |
![]() |
#205 |
Linux snob
Join Date: Sep 2008
Location: Monkey Island
Posts: 997
|
Beautiful.
![]() |
![]() |
![]() |
#206 |
Global Moderator
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
|
I bow
![]() |
![]() |
![]() |
#207 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Thanks chaps but there's still definitely some additional work required.
Currently this runs with 3 bitplanes (8 colours max) and the blitter work required to clear the screen, draw the lines and fill the polygons means that, along with the vector calculations as they stand, there isn't very much raster time left - I couldn't make the cube much bigger for example. Also, currently it can only draw / fill in three colours - colour 1, colour 2 and colour 4. Basically this is because, using these colours, it only has to draw lines once to each of the separate bitplanes ie. no dual drawing of lines into two or more bitplanes to get intermediate colours works at the moment. Still much more work and probably some rewrites to do on the routine as a whole before I can get anywhere near a lightsourced cube I reckon... |
![]() |
![]() |
#208 |
Linux snob
Join Date: Sep 2008
Location: Monkey Island
Posts: 997
|
I'm trying to get my mind around the chipset atm, and I can't see the problem with more than three colors. (Probably because I don't understand the matter.)
I mean, an opaque cube can show 4 sides max at one point in time. Can't you compute the shade (by the normal's angle to "lightsource", no funky phong stuff, just one color per side), write it to the first four color register and that's all? EDIT: Ok, not the first four color register but 1,2,4,8. Last edited by gilgamesh; 06 March 2010 at 22:13. |
![]() |
![]() |
#209 | ||
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Quote:
![]() Quote:
However to draw an "in between" colour (col 3, 5, 6 or 7) in a three bitplane display you have to write the same lines into two or more bitplanes which obviously takes more time than just writing the lines to one bitplane. Also, using the blitter to clear the screen and fill the polygons takes more and more time the more bitplanes it's doing this for. That's what I was getting at in regards to rewrites and additional work to do - I was more thinking in terms of gaining speed and therefore time available to do more on the screen at once other than just the cube. I'm always thinking in terms of demos you see. ![]() |
||
![]() |
![]() |
#210 | |
Linux snob
Join Date: Sep 2008
Location: Monkey Island
Posts: 997
|
Maybe a little microdemo someday. Right now I'm learning how the chipset works and write it down in the wiki. The Wiki would benefit from your knowledge, btw.
![]() Quote:
|
|
![]() |
![]() |
#211 | |||
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Quote:
Quote:
I'm sure there's guys here (StingRay, Leffman etc.) who are much better qualified to give you worthy insights but anything I can give, you're more than welcome. ![]() Quote:
![]() Looks to me like you think in exactly the right way to do some nice code - I'm looking forward to your first demo! ![]() That's step by step what I'm gonna add to the filled cube routine next so it becomes a lightsourced filled cube routine. Hopefully I can post the working result here soon. ![]() |
|||
![]() |
![]() |
#212 | ||
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,865
|
Quote:
- store min/max values of your object (can be done in your line drawer or in some little extra routine) to create a "bounding box", that way never have to clear/fill the whole screen - use interleaved bitplanes so you can fill/clear several bitplanes with one blitter start Quote:
![]() |
||
![]() |
![]() |
#213 | |||
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Quote:
Quote:
Quote:
Besides, I'm not sure I really need a fourth separate colour - my cube only ever shows three sides maximum at any one time so three colour regs should be fine for my needs and I'm already using three bitplanes. |
|||
![]() |
![]() |
#214 |
Linux snob
Join Date: Sep 2008
Location: Monkey Island
Posts: 997
|
![]() http://eab.abime.net/showthread.php?t=51243 from #28 onward ![]() |
![]() |
![]() |
#215 |
Registered User
Join Date: May 2004
Location: Somewhere secret
Age: 50
Posts: 366
|
pmc: interleaved bitplanes are just using your screen buffer as:
<screenwidth pixels of bitplane 0> <screenwidth pixels of bitplane 1> <etc.> This way you just adjust your modulo values and you can write to them as if they were 'normal', but you get the advantage of being able to clear with only 1 blitter start (as Sting said). Also good for blitting multicolour bobs etc. quickly... multiple uses ![]() |
![]() |
![]() |
#216 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Ah, OK. Makes sense. Thanks WayneK.
![]() Now that I've done a few things with wireframe vectors I definitely need to rewrite my vectors routines so they're more suited to filled stuff. From what I've discovered so far they need to be better optimised to gain as much speed as possible for the additional work required and I also need to add extra functionality, for example clipping so I can move things around the screen and stuff. Now just need to get to feel like I can be bothered to actually do it. ![]() While I'm here though I might as well ask another question: All this stuff so far has been fine for convex vectors, but what about concave (sometimes called inconvex - usually in Anarchy demos ![]() I take it some kind of sorting / painter algorithm is needed that draws things that are further away first and then overwrites them with things that are closer? |
![]() |
![]() |
#217 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Well chaps, check the attached Amiga executable for a light sourced filled cube.
![]() The code for this one is a complete and utter ugly hack but it works and in doing it I've learned some interesting things. So, does this mean I'm 1337 now then Stinger...? ![]() Last edited by pmc; 03 June 2010 at 09:01. |
![]() |
![]() |
#218 |
Linux snob
Join Date: Sep 2008
Location: Monkey Island
Posts: 997
|
What? I could watch this on end! Great work
![]() I don't know if z-buffer is possible on an Amiga. So I looked for examples and thought of "Alone in the Dark" to be the first. This lead me to Alpha Waves (Matt Barton mentioned it...) and know what? The whole source code for 68k assembler is on the net. ![]() Video & Discussion Source |
![]() |
![]() |
#219 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
What's z-buffer...?
I'm too lazy to spend any proper time or effort understanding other people's sources - trying to work out what they've done with their data and why they're manipulating it this way or that way. Too boring. I'd rather try coding it myself! \o/ |
![]() |
![]() |
#220 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,865
|
Lightsourced vector cube == you're an official elite coder now.
![]() If you understand how z-buffer works you'll realize that Z-Buffer is possible on Amiga but you don't want to do it on 68000. It's a very simple algorithm to draw correctly sorted objects. You store the z-values of the objects in a buffer (the z-buffer). For each(!) pixel you compare the value in the z-buffer with the actual z-value of your object and draw the pixel if act-z<z-buffer. Very simple to do and very slow (in software anyway) which is why it's not suitable for 68000 (and obviously it only works in chunky mode). Attached is the source of my old z-buffered texture mapper, reading the source should make it very easy to understand how z-buffering works (and why it is slow). Last edited by StingRay; 08 March 2010 at 22:36. |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Learning AMOS - Beginners Guide Disks | Peter | Retrogaming General Discussion | 15 | 28 October 2015 17:17 |
DiskImage: When learning to read proves futile. | XDelusion | support.Apps | 19 | 20 October 2012 23:57 |
Wanting to start learning to code amiga in asm | fishyfish | Coders. Asm / Hardware | 5 | 03 March 2012 06:11 |
Playpower - 8 bit learning games for the developing world | girv | Retrogaming General Discussion | 5 | 24 March 2009 22:00 |
Learning assembler | bLAZER | Coders. General | 1 | 12 May 2007 05:00 |
|
|