home *** CD-ROM | disk | FTP | other *** search
- VERSION 1.0 CLASS
- BEGIN
- MultiUse = -1 'True
- END
- Attribute VB_Name = "DistortTwist"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
-
- ' The center about which to twist.
- Public cx As Single
- Public cy As Single
-
- ' ************************************************
- ' Apply a shape distorting transformation to
- ' the point.
- ' ************************************************
- Sub Distort(x As Single, y As Single)
- Dim r As Single
- Dim dx As Single
- Dim dy As Single
-
- dx = x - cx
- dy = y - cy
- r = Sqr(dx * dx + dy * dy) / 350 / 3.14
-
- x = cx + dx * Sin(r) - dy * Cos(r)
- y = cy + dx * Cos(r) + dy * Sin(r)
- End Sub
-