Creating a Fisheye Effect with FreeHand/Illustrator

  • Thread starter Thread starter abeall
  • Start date Start date
AI Thread Summary
To create a fisheye effect in vector drawing applications like FreeHand or Illustrator, a distortion area is defined, affecting points within a specified range. The distortion can be circular or elliptical, with points outside this area remaining unchanged. The method involves calculating the angle between a point and the ellipse center, determining the intersection point on the ellipse perimeter, and measuring distances to apply a weight for distortion. Quadratic interpolation is then used to re-plot the affected points based on these calculations. This approach effectively achieves the desired fisheye effect.
abeall
Messages
21
Reaction score
0
I am looking to create a fisheye effect, similar to what can be found in computer vector drawing apps like Macromedia FreeHand or Adobe Illustrator:
http://www.vecpix.com/tutorials/freehand/images/fh004/3d_soccer09.gif

Note that this effect is not exactly the same as a fisheye lens. Here's a good example of what I want (screen captured from Freehand):
http://abeall.com/files/temp/fisheye.gif

1) Distortion area has a range of 1 to -1, where 1 pushes points that fall in the distortion area towards the edge, and -1 pulls points towards the center

2) The distortion area can be a circle or ellipse, though not a rotated ellipse.

3) Points outside the distortion area are not affected.

These values are known:
Each point x and y
Circle/ellipse center
Circle/ellipse width
Circle/ellipse height

Any help would be appreciated.
 
Last edited by a moderator:
Mathematics news on Phys.org
I got it working. For any future reference, here's what I did:

1) First I determine an radian angle between a given point and the ellipse center, like this:
atan2(p2.y - p1.y, p2.x - p1.x)
Where p1 is the ellipse center, p2 is the point to be deformed.

2) Then, based on that angle, I determine the point on the ellipse perimeter which intersects the center through that angle, like this:
r = 0.5 / sqrt( Math.cos(angle)/ellipse.width)^2 + (Math.sin(angle)/ellipse.height)^2 ) ;
x = center.x + r*cos(angle);
y = center.y + r*sin(angle);

3) Then I determine 2 distances: d1 is the distance from the ellipse center to the ellipse perimeter point as determined above, and d2 is the distance from the ellipse center to original point to be deformed. This gives me a weight via d2/d1.

4) I then re-plot the point based on quadratic interpolation:
-c *(t/d)*(t/d-2) + b
Where t is the time, or weight as determined above, b is the begin value (center point), c is the change in value (perimeter point - center point), and d is the duration, ie 1

It may be a strange approach, but it works.

- aaron
 
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Fermat's Last Theorem has long been one of the most famous mathematical problems, and is now one of the most famous theorems. It simply states that the equation $$ a^n+b^n=c^n $$ has no solutions with positive integers if ##n>2.## It was named after Pierre de Fermat (1607-1665). The problem itself stems from the book Arithmetica by Diophantus of Alexandria. It gained popularity because Fermat noted in his copy "Cubum autem in duos cubos, aut quadratoquadratum in duos quadratoquadratos, et...
Thread 'Imaginary Pythagorus'
I posted this in the Lame Math thread, but it's got me thinking. Is there any validity to this? Or is it really just a mathematical trick? Naively, I see that i2 + plus 12 does equal zero2. But does this have a meaning? I know one can treat the imaginary number line as just another axis like the reals, but does that mean this does represent a triangle in the complex plane with a hypotenuse of length zero? Ibix offered a rendering of the diagram using what I assume is matrix* notation...
Back
Top