DIV¿¡¼­ ÇÊÅÍ ¼Ó¼ºÀ¸·Î ȸÀü½ÃÅ°´Â ¿¹Á¦


Matrix ÇÊÅÍ ¿¹Á¦
ÇÊÅÍ Ç¥½Ãâ

ÁöÁ¤ÇÑ °¢µµ deg ¸¸Å­ °³Ã¼ÀÇ ³»¿ëÀÌ È¸ÀüÇÑ´Ù. ȸÀü Áß½ÉÁ¡ x, y ÁÂÇ¥¸¦ ´õÇØÁÖ¸é Áß½ÉÁ¡À» À̵¿ ½Ãų ¼ö ÀÖ´Ù.

<SCRIPT>
var deg2radians=Math.PI*2/360;
function doRotate(job,obj,deg){
  if (!job) obj.filters[0].Enabled=false;
  else if (job==1){
    obj.filters[0].Enabled=true;
    rad=deg*deg2radians;
    costheta=Math.cos(rad);
    sintheta=Math.sin(rad);
    obj.filters.item(0).M11=costheta;
    obj.filters.item(0).M12=-sintheta;
    obj.filters.item(0).M21=sintheta;
    obj.filters.item(0).M22=costheta;
  }
  str='';
  str+='obj.style.filter='+obj.style.filter+'<BR>';
  str+='¢¡Enabled=('+obj.filters[0].Enabled+'), ';
  str+='deg=('+deg+')<BR>';
  str+='M11=('+obj.filters.item(0).M11+'), ';
  str+='M12=('+obj.filters.item(0).M12+')<BR>';
  str+='M21=('+obj.filters.item(0).M21+'), ';
  str+='M22=('+obj.filters.item(0).M22+')';
  show2.innerHTML=str;
}
</SCRIPT>
<DIV id="obj2" style="width:600;height:400;font-size:10;line-height:1.2em;font-wright:bold;background-color:pink;
filter:progid:DXImageTransform.Microsoft.Matrix()">
<IMG src=../../gif/rfexample.gif><BR>
Matrix ÇÊÅÍ ¿¹Á¦
</DIV>
<BUTTON onClick="doRotate(0,obj2,30)" style="width:100">Á¤»ó À̹ÌÁö</BUTTON>
<BUTTON onclick="doRotate(1,obj2,20)" style="width:100">20° °¢µµ</BUTTON>
<BUTTON onclick="doRotate(1,obj2,30)" style="width:100">30° °¢µµ</BUTTON>
<BUTTON onclick="doRotate(1,obj2,60)" style="width:100">60° °¢µµ</BUTTON>
<BUTTON onclick="doRotate(1,obj2,-30)" style="width:100">À½¼ö °¢µµ</BUTTON>
<BUTTON onclick="doRotate(1,obj2,350)" style="width:100">350° °¢µµ</BUTTON>
<DIV id=show2 style="width:600;height:90;border:solid 1 blue;padding:3;font-size:90%">ÇÊÅÍ Ç¥½Ãâ</DIV>

Matrix ÇÊÅÍ ¿¹Á¦
ÇÊÅÍ Ç¥½Ãâ
<SCRIPT>
var deg2radians=Math.PI *2/360;
var gdeg=gmultiX=job=0;
var iCount=100;

function subRotation(deg){
  rad=deg*deg2radians ;
  costheta=Math.cos(rad);
  sintheta=Math.sin(rad);
  obj3.filters.item(0).M11=costheta;
  obj3.filters.item(0).M12=-sintheta;
  obj3.filters.item(0).M21=sintheta;
  obj3.filters.item(0).M22=costheta;
  gdeg=deg;
}

function subResize(multiX){
  obj3.filters.item(0).M11 *= multiX;
  obj3.filters.item(0).M12 *= multiX;
  obj3.filters.item(0).M21 *= multiX;
  obj3.filters.item(0).M22 *= multiX;
  gmultiX=multiX;
}

function doSpin(){
  if (!job) obj3.filters[0].Enabled=false;
  else {
    obj3.filters[0].Enabled=true;
    var multiX=iCount/360;
    if(job==2){
      iCount=95;
      multiX=0;
      job=0;
      obj3.filters[0].Enabled=false;
    }
    iCount+=5;
    if (iCount>360*2) return;
    if (job==3) obj3.onfilterchange=null;
    subRotation(iCount);
    subResize(multiX);
  }

  str='';
  str+='obj3.style.filter='+obj3.style.filter+'<BR>';
  str+='¢¡Enabled=('+obj3.filters[0].Enabled+'), ';
  str+='iCount=('+iCount+'), deg=('+gdeg+'), multiX='+gmultiX+')<BR>';
  str+='M11=('+obj3.filters.item(0).M11+'), ';
  str+='M12=('+obj3.filters.item(0).M12+')<BR>';
  str+='M21=('+obj3.filters.item(0).M21+'), ';
  str+='M22=('+obj3.filters.item(0).M22+')';
  show3.innerHTML=str;
}
</SCRIPT>

<DIV id="obj3" style="position:absolute;border:solid 1 blue;padding:5;
  filter:progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand')" onfilterchange="doSpin()">
<DIV style="background-color:pink;padding:5;border:solid 1 red">
<IMG src=../../../gif/rfexample.gif><BR>
Matrix ÇÊÅÍ ¿¹Á¦
</DIV>
</DIV>
<DIV style=height:200></DIV>
<BUTTON onClick="job=0;doSpin()" style="width:120">Á¤»ó À̹ÌÁö</BUTTON>
<BUTTON onclick="job=1;doSpin()" style="width:120">Matrix ÇÊÅÍ È¿°ú</BUTTON>
<BUTTON onclick="job=2;doSpin()" style="width:120">ÃʱâÈ­Çϱâ</BUTTON>
<BUTTON onclick="job=3;doSpin()" style="width:120">´Ü°èº° º¸±â</BUTTON>
<BUTTON onclick="document.location='../exp/xMatrix.html#exp3'" style="width:120">´Ù½Ã ·Îµù</BUTTON>
<DIV id=show3 style="width:600;height:90;border:solid 1 blue;padding:3;font-size:90%">ÇÊÅÍ Ç¥½Ãâ</DIV>