| |
Shadow Account closed
Registered: Apr 2002 Posts: 355 |
Creating angle/radius tables
Is there a size-optimized way of getting a angle and radius table? It's easy enough to just precalc like this (pseudocode):
for(int x=0;x<w;x++)
{
for(int y=0;y<h;y++)
{
radius[tab]=sqrt((x-w/2)*(x-w/2)+(y-h/2)*(y-h/2));
angle[tab]=atan2(y-h/2,x-w/2)/PI);
tab++;
}
}
But what if you don't want to have the whole table precalced due to size concerns? Can you save space with some smart mirrortricks, etc.? |
|
... 13 posts hidden. Click here to view all posts.... |
| |
Shadow Account closed
Registered: Apr 2002 Posts: 355 |
Thanks Krill, didn't remember that you had released the source to that amazing 4k, I will have to study that sometime!
Anyway, I sat down and thought it through some more, and the simple thing to do is to just do a mirror/flip with the four quadrants, thus only needing 1/4 of the table precalced, which saves enough space for now.
Perhaps it would be possible to get by with only one octant precalced, but I'm not going to pursue that right now.
|
| |
Style
Registered: Jun 2004 Posts: 498 |
Quote: Thanks Krill, didn't remember that you had released the source to that amazing 4k, I will have to study that sometime!
Anyway, I sat down and thought it through some more, and the simple thing to do is to just do a mirror/flip with the four quadrants, thus only needing 1/4 of the table precalced, which saves enough space for now.
Perhaps it would be possible to get by with only one octant precalced, but I'm not going to pursue that right now.
Never study other people's source - it spoils the fun!
|
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
lol, style, u wrong.
DO STUDY other ppl code, then you know if you can do it better, and u dont have to reinvent the wheel:)
edit: I really wonder how much time would it took for one single man to reinvent everything since 82 :D |
| |
Style
Registered: Jun 2004 Posts: 498 |
Ive never looked at other people's code, except for example routines in assembler books and a couple of routines Quetzal sent me once to explain how he did something (VSP from memory).
I like talking theory about how stuff works, but to actually look at code seems like cheating to me :)
|
| |
Jetboy
Registered: Jul 2006 Posts: 337 |
Quote: Ive never looked at other people's code, except for example routines in assembler books and a couple of routines Quetzal sent me once to explain how he did something (VSP from memory).
I like talking theory about how stuff works, but to actually look at code seems like cheating to me :)
O_O
Theory?
Do you think there were ANY theories avaliable back in the 80's?
The only theory you could get then was from examining other people's code.
Bah! Spoiled childs of the internet... |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
The early 80's was experimenting, the late 80's knew what they where doing with the HW imo. |
| |
Jetboy
Registered: Jul 2006 Posts: 337 |
with what? |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
For instance insane multiplexers, maximzing the number of $d020 splits... FLDs, FPPs, sprite stretching etc. etc. I really doubt the best VIC-coders back then ripped code and only applied trial and error etc. They created their own theories and models imo. Brainers usually does that, where as lamers don't. |
| |
Style
Registered: Jun 2004 Posts: 498 |
only teh lam0rxz rip!
Im a shit coder, but at least everything Ive written is mine alone.
|
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
Jack, I think they looked at the vic as a black box, if I do this then this will come out and so on. they barely could have ideas of inner counters and stuff.
fpp fld etc.. you dont need to have much idea about it. its enough to know the sequence of the numbers to write to d011 and the right cycle. Again, it can work like a black box without deeper vic knowledge.
IMHO :) |
Previous - 1 | 2 | 3 - Next |