如果你有好的背景音乐效果将更加震撼
<!-- website:http://www.knowsky.com -->
<!-- bbs:http://bbs.knowsky.com -->
<!-- 完整的HTML代码如下 -->
<HTML>
<HEAD>
<title>图片恐怖效果展示(网页教学网)</title>
<meta name="Author" content="http://www.knowsky.com">
<meta http-equiv="imagetoolbar" content="no">
<STYLE>
BODY {
cursor:url("../CRCROSS.cur");
}
</STYLE>
</HEAD>
<BODY bgColor=#000000 scroll=no onload="zyva()">
<DIV id=load style="font-family:courier;font-size:11pt;color:#FFFFFF">Loading... Please wait...</DIV>
<DIV id=images style="display:none">
<IMG src="http://www.knowsky.com/upfiles/20050411/20050411015633_tn3d_encours_z2.jpg">
</DIV>
<!-- DAControl layout -->
<OBJECT id=DAControl
style="position:absolute;Z-INDEX: -1; width=expression(document.body.offsetWidth);height=expression(document.body.offsetHeight*.66);left=0;top=expression((document.body.offsetHeight-(document.body.offsetHeight*.66))/2)"
classid=CLSID:B6FFC24C-7E13-11D0-9B47-00C04FC2F51D>
<PARAM NAME="OpaqueForHitDetect" VALUE="0">
<PARAM NAME="UpdateInterval" VALUE="0.030">
</OBJECT>
<!-- muzzik -->
<BGSOUND balance=0 src="dgate014.mid" volume=0 loop=infinite>
<SCRIPT>
// ======================================================
// http://www.knowsky.com
// ======================================================
var xm=ym=0
var m, PerCam
function programDA(){
m = DAControl.MeterLibrary
// square geometry (2 triangles)
square=m.TriMesh (2, new Array(1,0,-1,-1,0,-1,-1,0,1,1,0,-1,-1,0,1,1,0,1), new Array(0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0), new Array(1,1,0,1,0,0,1,1,0,0,1,0), null)
square = square.Transform(m.Scale3Uniform(0.05))
// light
geo = m.AmbientLight.LightColor(m.colorRgb255(255,255,255))
// position faces
addFace(0, m.xVector3,Math.PI/2, m.zVector3,Math.PI/2, 0.05,0,0)
addFace(0, m.zVector3,0, m.zVector3,0 , 0,-0.05,0)
addFace(0, m.yVector3,-Math.PI, m.xVector3,-Math.PI, 0,0.05,0)
addFace(0, m.xVector3,Math.PI/2, m.zVector3,-Math.PI/2, -0.05,0,0)
addFace(0, m.zVector3,0, m.xVector3,Math.PI/2, 0,0,-0.05)
addFace(0, m.zVector3,Math.PI, m.xVector3,-Math.PI/2, 0,0,0.05)
// rotation
geo = geo.Transform(m.Rotate3Rate(m.xVector3, 0.5)).Transform(m.Rotate3Rate(m.yVector3, 0.1)).Transform(m.Rotate3Rate(m.zVector3, 0.1))
// camera
PerCam = m.ModifiableBehavior(m.PerspectiveCamera(0.05,0.04))
// rendering
DAControl.Image = geo.render(PerCam)
}
function addFace(i, v1,r1, v2,r2, tx,ty,tz){
// import image
htmlTexture = m.ImportImage(images.children[i].src).MapToUnitSquare()
img = square.TextureImage(htmlTexture)
// orientation face
geo = m.UnionGeometry(geo,img.Transform(m.Rotate3(v2,r2)).Transform(m.Translate3(tx,ty,tz)).Transform(m.Rotate3(v1,r1)))
}
document.onmousemove = function(){
// mouse move
xm = window.event.x
ym = Math.abs(window.event.y - (document.body.offsetHeight*.5))
}
function Om(){
// --- change focal Length
p=0.005+ym/5000
PerCam.SwitchTo(m.PerspectiveCamera(p,p-0.001).Transform(m.Translate3(0,0,-p/4)).Transform(m.Rotate3(m.yVector3,xm/100)))
}
// --- start ------
function zyva(){
programDA()
DAControl.Start()
load.style.visibility="hidden"
setInterval("Om()",16)
}
// ----------------------
</SCRIPT>
</BODY></HTML>