A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: getRGB with rotation?

  1. #1
    anyone else hear that? flashpipe1's Avatar
    Join Date
    Jan 2003
    Location
    Upstate NY
    Posts
    1,929

    getRGB with rotation?

    I'm stumped...I've got a color wheel that I'm adjusting with sliders, and I need to get the rgb at a specific pixel location.

    I've got it working for the y slider, but can't figure out the math for the rotation slider...

    Anyone out there that can shed any light on this??
    Last edited by flashpipe1; 12-10-2008 at 02:15 PM.
    Love like you've never been hurt, live like there's no tomorrow and dance like nobody's watching.

  2. #2
    anyone else hear that? flashpipe1's Avatar
    Join Date
    Jan 2003
    Location
    Upstate NY
    Posts
    1,929
    Got it...In case anyone else needs to do something like this, I used the following equations to set the adjustX and adjustY.

    angle = the _x of the rot slider
    rad = the _x of the y slider

    adjustX=cx+Math.sin(angle)*rad;
    adjustY=cy+Math.sin(angle)*rad;

    Works GREAT!!

    Thanks!
    Love like you've never been hurt, live like there's no tomorrow and dance like nobody's watching.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center