Jump to content

# Layer Cake Plugin

## Recommended Posts

A new twist on the Twist.  Rotate your image in slices.

(The Original twist makes the image unrecognizable.)

Video instructions - http://youtu.be/Q6fPxBzQ4w8

This image was done with a round selection. (Mona's one Twisted sister.)

Distort -> Layer Cake

Bug Fix -Version 1.1 Fixes Zero Rotation Issue

10:38 AM Wednesday, June 12, 2013 (UTC)

The Code:

Hidden Content:
```// Submenu: Distort
// Name: Layer Cake
// Title: Layer Cake - v1.1
// Author: TechnoRobbo
// URL: http://www.technorobbo
#region UICode
double Amount1 = 0;//[-10,10]Rotation
double Amount2 = 5;//[1,30]Slices
#endregion

void Render(Surface dst, Surface src, Rectangle rect)
{

Rectangle selection = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt();
int CenterX = ((selection.Right - selection.Left) / 2)+selection.Left;
int CenterY = ((selection.Bottom - selection.Top) / 2)+selection.Top;
double radX = (selection.Right - selection.Left) / 2;
double radY = (selection.Bottom - selection.Top) / 2;
double offrads = 0;
double rads = 0;
double slices = 0;
int newx = 0;
int newy = 0;
double maxrad = Math.Sqrt(radX * radX + radY * radY);
ColorBgra CP;

rads=  Math.PI * (Amount1 +.001);

for (int y = rect.Top; y < rect.Bottom; y++)
{

for (int x = rect.Left; x < rect.Right; x++)
{

slices = Math.Sqrt((x-CenterX) * (x-CenterX) + (y-CenterY)* (y-CenterY)) * rads / maxrad;
offrads = Math.Truncate(slices / (rads / Amount2)) * (rads / Amount2);

newx=CenterX + (int)(Math.Cos(offrads) * (x-CenterX) + Math.Sin(offrads) * (y-CenterY));
newy=CenterY + (int)(Math.Cos(offrads) * (y-CenterY) - Math.Sin(offrads) * (x-CenterX));
CP = src.GetBilinearSampleWrapped(newx,newy);

dst[x,y] = CP;
}
}
}
```

Layer Cake.zip

Edited by TechnoRobbo

Go out there and be amazing. Have Fun, TR

Some Pretty Pictures Some Cool Plugins

##### Share on other sites

Great plug-in. Played all morning, I think I'll go eat breakfast now.

Nice if it had an icon.

Edited by doughty

##### Share on other sites

My result after cutting and pasting individual slices on to separate layers, then adding drop shadow on each layer. Great plugin with interesting uses.

##### Share on other sites

Doughty: He should use the  icon

Looks like Sasha and I had similar ideas with the drop shadow

Edited by Daniels
##### Share on other sites

Nice effect!

Any number of Slices + Rotation: 0.00 and I get a completely filled layer in exactly one hue.  I anticipated getting a copy of the original (with zero rotation).

##### Share on other sites

By using a gold texture and also some cutting/pasting to layers I used rotate/zoom and trial to create a nice base for a trophy or lamp.

Nice examples here and some creative uses

##### Share on other sites

Ego - zero rotation bug fixed and uploaded. I gotta handed to the creativity of the members. Really nice work.

Go out there and be amazing. Have Fun, TR

Some Pretty Pictures Some Cool Plugins

##### Share on other sites

You make weird plugins. I like it!

ambigram signature by Kemaru

[i write plugins and stuff]

If you like a post, upvote it!

##### Share on other sites

• 1 year later...

This is magical, i have actually been wanting to request this

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×

• #### Activity

• Leaderboard
×
• Create New...