Creating a Fisheye Effect with FreeHand/Illustrator

  • Thread starter Thread starter abeall
  • Start date Start date
Click For Summary
SUMMARY

The discussion focuses on creating a fisheye effect using vector drawing applications such as Macromedia FreeHand and Adobe Illustrator. Key techniques include determining the angle between a point and the ellipse center using the atan2 function, calculating the intersection point on the ellipse perimeter, and applying quadratic interpolation for point re-plotting. The distortion area is defined by a range of 1 to -1, affecting points within a specified circle or ellipse, while points outside remain unchanged. The method outlined effectively achieves the desired fisheye effect.

PREREQUISITES
  • Understanding of vector graphics concepts in Adobe Illustrator and Macromedia FreeHand
  • Familiarity with trigonometric functions, specifically atan2
  • Knowledge of quadratic interpolation techniques
  • Basic understanding of coordinate geometry and ellipse properties
NEXT STEPS
  • Research "Quadratic interpolation in graphics programming"
  • Explore "Trigonometric functions in JavaScript for graphics"
  • Learn about "Ellipse properties and their applications in vector graphics"
  • Investigate "Advanced distortion effects in Adobe Illustrator"
USEFUL FOR

Graphic designers, digital artists, and developers interested in creating distortion effects in vector graphics applications.

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
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
8K
Replies
0
Views
2K
  • · Replies 6 ·
Replies
6
Views
4K
Replies
1
Views
2K
  • · Replies 42 ·
2
Replies
42
Views
7K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 0 ·
Replies
0
Views
6K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K