El Sid Posted April 7, 2007 Share Posted April 7, 2007 I'm Trying To Make This Work. int Amount1=0; //[0,100]Slider 1 Description int Amount2=0; //[0,100]Slider 2 Description int Amount3=0; //[0,100]Slider 3 Description void Render(Surface dst, Surface src, Rectangle rect) { PdnRegion selectionRegion = EnvironmentParameters.GetSelection(src.Bounds); Surface dst = dstArgs.Surface; Rectangle selection = this.EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); long CenterX = (long)(((selection.Right - selection.Left) / 2)+selection.Left); long CenterY = (long)(((selection.Bottom - selection.Top) / 2)+selection.Top); for(int y = rect.Top; y < rect.Bottom; y++) { for (int x = rect.Left; x < rect.Right; x++) { double r = System.Math.Sqrt(x * x + y * y); dst[x,y] = src[r, CenterY]; } } } Basically It Move Pixels To The Center And Then Moving Them Right Based On The Radius Value, If I Knew How To Move The Pixels Then I Could Easily Finish It (And Make The Pixels On The Left Go To The Left As Well) So Yeah. Any Help Would Be Appreciated. Quote Link to comment Share on other sites More sharing options...
Illnab1024 Posted April 8, 2007 Share Posted April 8, 2007 Okay, I got it. You weren't thinking in the right direction int Amount1=0; //[0,100]Slider 1 Description int Amount2=0; //[0,100]Slider 2 Description int Amount3=0; //[0,100]Slider 3 Description void Render(Surface dst, Surface src, Rectangle rect) { Rectangle selection = this.EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); float width = dst.Bounds.Right - dst.Bounds.Left; long CenterX = (long)(((selection.Right - selection.Left) / 2)+selection.Left); long CenterY = (long)(((selection.Bottom - selection.Top) / 2)+selection.Top); float r, theta, offx, offy, setx, sety; for(int y = rect.Top; y < rect.Bottom; y++) { for (int x = rect.Left; x < rect.Right; x++) { r = y/2; theta = (float)((System.Math.PI*2)*(x/width)); offx = (float)(r*System.Math.Cos(theta)); offy = (float)(r*System.Math.Sin(theta)); setx = (float)(CenterX+offx); sety = (float)(CenterY-offy); dst[x,y] = src.GetBilinearSample(setx, sety); } } } It's actually rather simple. Quote ~~ Link to comment Share on other sites More sharing options...
El Sid Posted April 8, 2007 Author Share Posted April 8, 2007 Haha, Nice One Illnab. Very Good. (Not Perfect But Meh) Quote Link to comment Share on other sites More sharing options...
Illnab1024 Posted April 8, 2007 Share Posted April 8, 2007 Not Perfect how? rect to polar consumes a looooot of quality from the image (y row is just a little better than half quality, x row is worse at the top and better at the bottom) Quote ~~ Link to comment Share on other sites More sharing options...
El Sid Posted April 8, 2007 Author Share Posted April 8, 2007 I Don't Expect You To Get It Perfect BTW, But Much Thanks For It. Steps For Unpefrectness: 1. New 400x400 Image 2. Make New Layer 3. Horizontal Line With Width Of 20 in middle 4. run rect to polar 5. run codelab script It's Still Pretty **** Good In My Opinion. EDITED: This is a family friendly site. Please reserve the cussing for your mother. ~BoltBait Quote Link to comment Share on other sites More sharing options...
Illnab1024 Posted April 8, 2007 Share Posted April 8, 2007 That's just a quality issue. Quote ~~ Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.