98、点光源技术

98、点光源技术

脚本说明:

第一步:把如下代码加入<body>区域中

<SCRIPT language=javascript>

<!--

function window_onload()                  

        {       

       point.filters.light(0).addAmbient(255,255,255,30);

              point.filters.light(0).addPoint(100,100,200,255,255,255,100);

        }

function MouseMove()       

        {

        point.filters.light(0).MoveLight(1,window.event.x-80,window.event.y-30,100,1);

        }

//-->

</SCRIPT>

 

<STYLE>A {

       COLOR: rgb(0,128,255); TEXT-DECORATION: none

}

A:hover {

       COLOR: rgb(0,0,255); TEXT-DECORATION: underline

}

SPAN.content {

       FONT-SIZE: 9pt

}

TD {

       FONT-SIZE: 9pt; COLOR: rgb(0,0,0)

}

</STYLE>

<DIV onmousemove=javascript:MouseMove() id=point

style="FILTER: light; LEFT: 216px; WIDTH: 400px; COLOR: white; POSITION: absolute; TOP: 92px; HEIGHT: 335px">

<TABLE height=305 cellSpacing=0 cellPadding=0 width="100%" border=0>

  <TBODY>

  <TR>

    <TD width="100%" height=59>

      <DIV align=center><SPAN

      style="FONT-SIZE: 14pt; COLOR: rgb(0,128,255); FONT-FAMILY: 幼圆, 宋体; BACKGROUND-COLOR: rgb(255,255,255)">点光源技术</SPAN></DIV></TD></TR>

  <TR bgColor=#999999>

    <TD width="100%" height=50><SPAN

      class=content>AddPoint方法可以创建一个沿X,Y,Z轴设置的点光源,在点光源的边缘光线平滑溶入背景,点光源的照亮范围可以由强度和它没Z轴远离页面的距离决定。<BR>point.filters.light(0).addPoint(200,200,200,255,255,255,100)<BR>{object.filters.light(n).addPoint(x,y,z,R,G,B,strength)}</SPAN></TD></TR>

  <TR>

    <TD width="100%" height=70>

      <DIV align=center>

      <CENTER>

      <TABLE cellSpacing=1 cellPadding=0 rules=rows width="100%" bgColor=#ffffff

      border=1 frame=below>

        <TBODY>

        <TR>

          <TD width="22%"><SPAN class=content>参数</SPAN></TD>

          <TD width="78%"><SPAN class=content>描述</SPAN></TD></TR>

        <TR>

          <TD width="22%"><SPAN class=content>x,y,z</SPAN></TD>

          <TD width="78%"><SPAN class=content>点光源坐标</SPAN></TD></TR>

        <TR>

          <TD width="22%"><SPAN class=content>R,G,B</SPAN></TD>

          <TD width="78%"><SPAN class=content>色彩值</SPAN></TD></TR>

        <TR>

          <TD width="22%"><SPAN class=content>Strength</SPAN></TD>

          <TD width="78%"><SPAN

      class=content>强度值</SPAN></TD></TR></TBODY></TABLE></CENTER></DIV></TD></TR>

  <TR bgColor=#999999>

    <TD width="100%" height=26><SPAN

      class=content>MoveLight方法可以改变光源的X,Y,Z各坐标的值,可产生光线运动的效果。<BR>{object.filters.Light(n).MoveLight(lightnumber,x,y,z,fAbsolute)}</SPAN></TD></TR>

  <TR>

    <TD width="100%" height=54>

      <TABLE cellSpacing=1 cellPadding=0 width="100%" bgColor=#ffffff

        border=1><TBODY>

        <TR>

          <TD width="22%"><SPAN class=content>参数</SPAN></TD>

          <TD width="78%"><SPAN class=content>描述</SPAN></TD></TR>

        <TR>

          <TD width="22%"><SPAN class=content>lightnumber</SPAN></TD>

          <TD width="78%"><SPAN class=content>标识光源的数字</SPAN></TD></TR>

        <TR>

          <TD width="22%"><SPAN class=content>fAbsolute</SPAN></TD>

          <TD width="78%"><SPAN

        class=content>设置移动是相对的还是绝对的</SPAN></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV>

 

 

 

第二步:把<body>中的内容改为:

<body  onload=javascript:window_onload()>

 

Write a comment

Comments: 0