VOGONS


First post, by superfury

User metadata
Rank l33t++
Rank
l33t++

UniPCemu currently just uses a simple dead zone, drawing a square around the 0,0 coordinate, then from that square onwards to the outer edge square(which is drawn at -32768,-32768-32767,32767) it accelerates by simple multiplication the given remainder of the area to the resulting x,y, coordinate to once again use the full 16-bit range again.

Does anyone know how to accomplish this with circles? So I want a circle around 0,0 of a certain radius, then a circle around the 16-bit range radius, change everything within said radius to 0,0 , while everything outside said circle(actually from the radius and onwards) until the border of the circle being accelerated as far as the border of the circle for said angle?

Anyone knows a formula to use for this?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 1 of 1, by dr_st

User metadata
Rank l33t
Rank
l33t

Sounds like a problem to solve by switching to polar coordinates. x = rcosa, y = rsina, where r is the radius and a is the angle. For r < Rthresh you would just assign r = 0. For Rthresh < r < Rmax you would do r = (Rmax)*(r-Rthresh)/(Rmax-Rthresh). Or something like that.

That's assuming you have an efficient way of computing the trigonometric functions.

https://cloakedthargoid.wordpress.com/ - Random content on hardware, software, games and toys