Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Creating angle/radius tables
2006-08-21 07:34
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....
 
2006-08-21 21:17
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.
2006-08-22 06:09
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!
2006-08-22 06:40
Oswald

Registered: Apr 2002
Posts: 5023
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
2006-08-22 06:45
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 :)
2006-08-22 08:02
Jetboy

Registered: Jul 2006
Posts: 220
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...
2006-08-22 08:04
JackAsser

Registered: Jun 2002
Posts: 1989
The early 80's was experimenting, the late 80's knew what they where doing with the HW imo.
2006-08-22 08:06
Jetboy

Registered: Jul 2006
Posts: 220
with what?
2006-08-22 08:08
JackAsser

Registered: Jun 2002
Posts: 1989
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.
2006-08-22 09:30
Style

Registered: Jun 2004
Posts: 498
only teh lam0rxz rip!

Im a shit coder, but at least everything Ive written is mine alone.
2006-08-22 09:32
Oswald

Registered: Apr 2002
Posts: 5023
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
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
curtcool
MightyAxle
QuasaR/CENTRiC
Epyx
Airwolf/F4CG
Martin Piper
bugjam
controlport2
AMB/Level 64
Arcane/Glance
chronos/Therapy
Stainless Steel/F4CG
Guests online: 118
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Memento Mori  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Dawnfall V1.1  (9.5)
8 Quadrants  (9.5)
9 Daah, Those Acid Pil..  (9.5)
10 Birth of a Flower  (9.5)
Top Groups
1 Nostalgia  (9.3)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Fullscreen Graphicians
1 Carrion  (9.8)
2 Joe  (9.8)
3 Duce  (9.8)
4 Mirage  (9.7)
5 Facet  (9.7)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.042 sec.