where the screen is divided in 24 segments using bit shifting to find each segment of a quadrant, I could divide in much finer details (16 segments per quadrant). And I managed to draw something like each quadrant, but then I need to find the distance and.. honestly the code is so gross already that I might as well do something else-
Ouch, your environment is giving you a hard time! If you are willing to cheat: math.atan(y/x) is "approximately" the same as y/x (sizecoding trick courtesy of Pestis) . Of course it isn't a great approximation, but you'll end up with something looking like this:
@lovebyteparty I think that if I can test the distance against a sin table, then I should have something that looks like perspective! Thanks for the help with this ^__^
tomas
in reply to Devine Lu Linvega • • •that said, it's also a very very cool thing
you could apply the same function for reading a joystick signal for example
or create little boids with steering behavious that fly around
atan2 is very cool
Devine Lu Linvega
in reply to Devine Lu Linvega • • •Devine Lu Linvega
in reply to Devine Lu Linvega • • •Devine Lu Linvega
in reply to Devine Lu Linvega • • •Philip Nelson
in reply to Devine Lu Linvega • • •Devine Lu Linvega
in reply to Philip Nelson • • •テオ
in reply to Devine Lu Linvega • • •aldroidia
in reply to Devine Lu Linvega • • •Z@b0\/\/
in reply to Devine Lu Linvega • • •YRabbit
in reply to Devine Lu Linvega • • •Marquee Design
in reply to Devine Lu Linvega • • •Devine Lu Linvega
in reply to Marquee Design • • •https://raw.githubusercontent.com/dustmop/arctan24/master/arctan.asm
where the screen is divided in 24 segments using bit shifting to find each segment of a quadrant, I could divide in much finer details (16 segments per quadrant). And I managed to draw something like each quadrant, but then I need to find the distance and.. honestly the code is so gross already that I might as well do something else-
Marquee Design
in reply to Devine Lu Linvega • • •Lovebyte Demoparty
in reply to Devine Lu Linvega • • •Lovebyte Demoparty
in reply to Devine Lu Linvega • • •Lovebyte Demoparty
in reply to Devine Lu Linvega • • •"instead of r² = x² + y² leaving out the square root also works -> r = x² + y² when done well, the difference is almost not noticeable" - Hellmood
"atan2 is tricky to simulate... trust me i tried" - Superogue
Devine Lu Linvega
in reply to Lovebyte Demoparty • • •back to the drawing board
Devine Lu Linvega
in reply to Devine Lu Linvega • • •Lovebyte Demoparty
in reply to Devine Lu Linvega • • •Devine Lu Linvega
in reply to Devine Lu Linvega • • •