html--直升飞机


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <HEAD>
  <TITLE> New Document </TITLE>
  <META NAME="Generator" CONTENT="EditPlus">
  <META NAME="Author" CONTENT="">
  <META NAME="Keywords" CONTENT="">
  <META NAME="Description" CONTENT="">
  <style>
  body{
  background-color: #013;
}
canvas{
	background-image: linear-gradient(bottom, #000 0%, #013 100%);
}
  </style>
 </HEAD>

 <BODY>
 <script type="text/javascript" src="https://admiralpotato.github.io/js/npos3d/build/npos3d.min.js"></script>
  <script>
  n = NPos3d;
s = new n.Scene({
  lineWidth: 2,
  backgroundColor: 'transparent',
  canvasStyleColor: 'transparent'
});

orbit = new n.Ob3D({
  rot: [65 * deg, 0, 0],
  shape:{}
});

rStyle = 'lines'; //Options are: 'both', 'points' and 'lines'
bodyColor = '#999';
body = new n.Ob3D({
  pos: [-200,0,0],
  shape: {},
  renderStyle: rStyle
});
bodySideOffset = 15;
bodySideRot = [deg * -90, deg * -90, 0];
bodySideString = 'rofl';
bodySideL = new n.VText({
  rot: bodySideRot,
  string: bodySideString,
  pos: [-bodySideOffset,0,0],
  color: bodyColor,
  renderStyle: rStyle
});
bodySideR = new n.VText({
  rot: bodySideRot,
  string: bodySideString,
  pos: [bodySideOffset,0,0],
  color: bodyColor,
  renderStyle: rStyle
});
windShieldOffset = bodySideOffset*1.5;
windShildRot = [deg * -45, 0, 0];
windShieldColor = '#09f';
windShieldL = new n.VText({
  rot: windShildRot,
  string: '(',
  pos: [-windShieldOffset,60,0],
  color: windShieldColor,
  renderStyle: rStyle
});
windShieldR = new n.VText({
  rot: windShildRot,
  string: ')',
  pos: [windShieldOffset,60,0],
  color: windShieldColor,
  renderStyle: rStyle
});
windShieldC = new n.VText({
  rot: windShildRot,
  string: 'O',
  pos: [0,80,0],
  color: windShieldColor,
  renderStyle: rStyle
});
landingGearOffsetX = 30;
landingGearOffsetZ = 40;
landingGearString = ':';
landingGearL = new n.VText({
  string: landingGearString,
  pos: [-landingGearOffsetX,0,-landingGearOffsetZ],
  renderStyle: rStyle
});
landingGearR = new n.VText({
  string: landingGearString,
  pos: [landingGearOffsetX,0,-landingGearOffsetZ],
  renderStyle: rStyle
});

bladePosY = 12;
bladeStock = new n.VText({
  string: '!',
  pos: [0,-bladePosY,25],
  rot: [-90 * deg, 0, 0],
  renderStyle: rStyle
});
bladeParent = new n.VText({
  string: '*',
  pos: [0,-bladePosY,45],
  scale: [0.5,0.5,0.5],
  fontSize: 64,
  renderStyle: rStyle
});
bladeOffset = 40;
bladeString = 'ROFL ROFL ROFL';
bladeAlign = 'left';
bladeRotX = deg * -25;
bladeRotOrder = [2,0,1];
bladeA = new n.VText({
  pos: [bladeOffset,0,0],
  string: bladeString,
  textAlign: bladeAlign,
  rot: [bladeRotX, 0, 0],
  rotOrder: bladeRotOrder,
  renderStyle: rStyle
});
bladeB = new n.VText({
  pos: [-bladeOffset,0,0],
  string: bladeString,
  textAlign: bladeAlign,
  rot: [bladeRotX, 0, pi],
  rotOrder: bladeRotOrder,
  renderStyle: rStyle
});
bladeC = new n.VText({
  pos: [0,bladeOffset,0],
  string: bladeString,
  textAlign: bladeAlign,
  rot: [bladeRotX, 0, deg * 90],
  rotOrder: bladeRotOrder,
  renderStyle: rStyle
});
bladeD = new n.VText({
  pos: [0,-bladeOffset,0],
  string: bladeString,
  textAlign: bladeAlign,
  rot: [bladeRotX, 0, deg * -90],
  rotOrder: bladeRotOrder,
  renderStyle: rStyle
});
blinkerOffset = 390;
blinkerColor = '#f00';
bladeABlinker = new n.VText({
  string: '*',
  pos: [blinkerOffset, 0, 0],
  rot: [bladeRotX,0,0],
  rotOrder: bladeRotOrder,
  color: blinkerColor,
  renderStyle: rStyle
});
bladeBBlinker = new n.VText({
  string: '*',
  pos: [-blinkerOffset, 0, 0],
  rot: [bladeRotX,0,pi],
  rotOrder: bladeRotOrder,
  color: blinkerColor,
  renderStyle: rStyle
});

tailBase = new n.VText({
  string: 'lol lol lol',
  textAlign: 'right',
  pos: [0, -55, -10],
  rot: bodySideRot,
  fontSize: 24,
  color: bodyColor,
  renderStyle: rStyle
});
tailTip = new n.VText({
  string: 'lol',
  textAlign: 'right',
  pos: [-210, 0, 0],
  rot: [0, 0, 45],
  fontSize: 24,
  color: bodyColor,
  renderStyle: rStyle
});


tailBladeOffset = 20;
tailBladefontSize = 12;
tailBladeString = 'LOL';
tailBladeParent = new n.VText({
  string: '*',
  pos: [-20, 0, 15],
  renderStyle: rStyle
});
tailBladeA = new n.VText({
  string: tailBladeString,
  textAlign: 'left',
  fontSize: tailBladefontSize,
  pos: [tailBladeOffset, 0, 0],
  rot: [bladeRotX, 0, 0],
  rotOrder: bladeRotOrder,
  renderStyle: rStyle
});
tailBladeB = new n.VText({
  string: tailBladeString,
  textAlign: 'left',
  pos: [-tailBladeOffset, 0, 0],
  rot: [bladeRotX, 0, pi],
  rotOrder: bladeRotOrder,
  fontSize: tailBladefontSize,
  renderStyle: rStyle
});
tailBladeC = new n.VText({
  string: tailBladeString,
  textAlign: 'left',
  pos: [0, tailBladeOffset, 0],
  rot: [bladeRotX, 0, deg * 90],
  rotOrder: bladeRotOrder,
  fontSize: tailBladefontSize,
  renderStyle: rStyle
});
tailBladeD = new n.VText({
  string: tailBladeString,
  textAlign: 'left',
  pos: [0, -tailBladeOffset, 0],
  rot: [bladeRotX, 0, deg * -90],
  rotOrder: bladeRotOrder,
  fontSize: tailBladefontSize,
  renderStyle: rStyle
});

tailBladeBlinkerOffset = 50;
tailBladeABlinker = new n.VText({
  string: '*',
  pos: [tailBladeBlinkerOffset, 0, 0],
  rot: [bladeRotX,0,0],
  rotOrder: bladeRotOrder,
  fontSize: tailBladefontSize,
  color: blinkerColor,
  renderStyle: rStyle
});
tailBladeBBlinker = new n.VText({
  string: '*',
  pos: [-tailBladeBlinkerOffset, 0, 0],
  rot: [bladeRotX,0,pi],
  rotOrder: bladeRotOrder,
  fontSize: tailBladefontSize,
  color: blinkerColor,
  renderStyle: rStyle
});


s.add(orbit);
orbit.add(body);
body.add(bodySideL);
body.add(bodySideR);
body.add(windShieldL);
body.add(windShieldR);
body.add(windShieldC);
body.add(landingGearL);
body.add(landingGearR);
body.add(bladeStock);
body.add(bladeParent);
bladeParent.add(bladeA);
bladeParent.add(bladeB);
bladeParent.add(bladeC);
bladeParent.add(bladeD);
bladeParent.add(bladeABlinker);
bladeParent.add(bladeBBlinker);
body.add(tailBase);
tailBase.add(tailTip);
tailTip.add(tailBladeParent);
tailBladeParent.add(tailBladeA);
tailBladeParent.add(tailBladeB);
tailBladeParent.add(tailBladeC);
tailBladeParent.add(tailBladeD);
tailBladeParent.add(tailBladeABlinker);
tailBladeParent.add(tailBladeBBlinker);


animationController = {
  update: function() {
    if(s.mpos.x === 0 && s.mpos.y === 0){ //if the user hasn't moved the mouse
      orbit.rot[2] -= deg;
      //orbit.rot[1] = sin(orbit.rot[2] * 5) * 0.5; //the pilot's been drinking!
      body.pos[2] = (cos(orbit.rot[2] * 3) * 50) + 60;
    } else {
      orbit.rot[2] = ((-s.mpos.x / 2) - 90) * deg;
      body.pos[2] = -s.mpos.y;
    }
    bladeParent.rot[2] += -46 * deg;
    tailBladeParent.rot[2] = bladeParent.rot[2];
  }
};

s.add(animationController);
  
  </script>
 </BODY>
</HTML>


在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

fo安方

觉得俺的文章还行,感谢打赏,爱

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值