| |
LHS
Registered: Dec 2002 Posts: 66 |
rotating chessboard
Hello, how to code a "simple" monochrome rotating (+zooming) chessboard, like the part after intro in Deus Ex Machina?
I'm thinking on line rutines for filled vector (when x' = x+1). Just draw on screen a few lines, then a few lines rotated 90dgrs, it gives a "chessboard net". But then the EOR filling doesn't fill corectly, because the first (upper) line isn't prepared. This first line is filled only by end-points of vector lines. Is this a right thought? How to prepare the upper line? |
|
| |
Cruzer
Registered: Dec 2001 Posts: 1048 |
Guess you could check whether the upper left corner is filled or not based on its position, then draw some lines between the chessboard lines' intersection with the upper line. |
| |
LHS
Registered: Dec 2002 Posts: 66 |
I was thinking on similar procedure - additionally fill the upperline between the intersections. But I wasn't sure, if is this usable (or if doesn't exist a better hint). Thanks. |
| |
WVL
Registered: Mar 2002 Posts: 886 |
If you really want to do it this way, then determining the first pixel and then EOR-filling-from-left-to-right in the first line is all you need to do.
After that, you can eor-fill from top-to-bottom.
But this is really not how the rotator in DeM or Dawnfall works. The rotators in PfP and Mekanix use a different technique also (completely unlike DeM and Dawnfall).
If you insist on programming it like this, then prepare for it to be really really slow, like really. |
| |
chatGPZ
Registered: Dec 2001 Posts: 11108 |
haha i coded one like this.... and i think wvl is underestimating the fact that it'll be like really really slow =D |
| |
WVL
Registered: Mar 2002 Posts: 886 |
OK, so how slow was it? :D Still measurable in frames per second, or did you need seconds per frame? ;)
Depending on the size, i'd guess a 16x16 char area would become like 10fps or so. |
| |
chatGPZ
Registered: Dec 2001 Posts: 11108 |
well my version was fullscreen und used a rather non optimized multicolor line drawer and even worse filler =) might have been a frame per second or.... maybe less =) |
| |
JackAsser
Registered: Jun 2002 Posts: 1989 |
Quote: If you really want to do it this way, then determining the first pixel and then EOR-filling-from-left-to-right in the first line is all you need to do.
After that, you can eor-fill from top-to-bottom.
But this is really not how the rotator in DeM or Dawnfall works. The rotators in PfP and Mekanix use a different technique also (completely unlike DeM and Dawnfall).
If you insist on programming it like this, then prepare for it to be really really slow, like really.
But those in PfP and Mekanix do not have rotation and zooming separated.... The one I did in Andropolis have those properties separated though but ofcourse have silly visual bugs (which I nowadays know how to remove thanx to the intro rotator in Mekanix).
All those rotators other than simple EOR-fillers are quite hard to explain actually and will take forever to elaborate here without pen and paper, honestly. All 50 FPS ones uses char mode though with predefined charsets and tricky methods for determining what charset and what char to display at each point. |
| |
WVL
Registered: Mar 2002 Posts: 886 |
Anyway, I'd suggest one using 3 buffers :
1 for drawing only lines in, and 2 for the final eored-picture.
This way, you only have to clear the lines in the first buffer when drawing a new frame, and not the whole eorred picture (saves a lot of cycles).
So :
1) draw lines in buffer 1
2) eor into buffer 2
3) clear lines in buffer 1
4) draw lines in buffer 1
5) eor into buffer 3
6) clear lines in buffer 1
7) draw lines in buffer 1
8) eor into buffer 2
repeat
Oh, and LOL at one second per frame :D
Oh, and also I'm willing to explain in detail how the charset bases rotators work, if anyone is interested. |
| |
Mace
Registered: May 2002 Posts: 1799 |
@WVL: I'm interested as long as it doesn't mean that I have to make one afterwards ;-) |
| |
chatGPZ
Registered: Dec 2001 Posts: 11108 |
hihi |
... 19 posts hidden. Click here to view all posts.... |
Previous - 1 | 2 | 3 - Next |