3D HTML伍 Logo标识 超炫丽旋转特效葡京在线开户

葡京在线开户 1

前日又要为大家带来一款超酷的HTML5 Canvas
3D动画特效,是壹款能够旋转的HTML伍Logo标识。画面上累计有两块可旋转的区域,第叁是可旋转的背景,第二则是可旋转的Logo标识。图标标识在转动的时候还有3D的视觉效果,这一切大家都是在canvas上贯彻的。具体演示和贯彻进程能够看下文。

葡京在线开户 2

葡京在线开户 3

谈到Yi Zhongtian,就会回想叁国,也会回想百家讲坛。Yi Zhongtian在百家讲坛品三国,因其白话式的幽默分析,受到追捧。Yi Zhongtian自从上了《百家讲坛》今后,从贰个名不见经传的我们成为三个“歌手学者”,从二个惯常的助教成为一个“一流教授”,那种场合被人们称作Yi Zhongtian现象。

你也足以在那边查看在线演示

葡京在线开户 4

下边大家来总结解析一下完成那款3D动画的进程及其部分基本代码,首要由HTML代码以及Javascript代码组成。

在学术上有一定见解的Yi Zhongtian,生活中也是很有灵气的。当自个儿的幼女高3时,想请老爹对谐和填报高等高校统招考试志愿提些参考意见时,Yi Zhongtian给闺女的提出却是”四项骨干规范”。那1着力规则也让9玖%的家中在高等高校统招考试时收益匪浅。

HTML代码:

“四项基本原则”正是:兴趣原则,你选的标准应该是您最感兴趣的;优势条件,你选的科班必须最能体现你的优势;创建条件,那个规范毕业之后转业的行事要负有创建性,而不是粗略的重复劳动;受益原则,这一个正式必须持有美貌的发展前途,最佳能(CANON)够赚钱。

<canvas id="canvas" style="background-color:#ddd"></canvas>

葡京在线开户 5

13分简单,仅仅是布局了三个canvas容器,接下去的3D动画,包含旋转的特效都将要此处绘制和促成。

乐趣原则:正是选项大学专门的学问时,能够从兴趣上入手,而不是从火热或冷门,更不是就业薪资方面。兴趣是人生最佳的助教,高等学校统招考试志愿填报应该是学员自个儿依照心中的乐趣做出剖断,不该掺杂太多外来因素。家长和外边太多的加入,看似关切子女的前程,实则适得其反。

Javascript代码:

优势条件:选取专门的职业时,丰硕的表达本人的优势才干,本领够集中大千世界智慧。各种人的优势本事都不等同,选拔标准时,尽恐怕的找到与温馨的优势相结合的正规化,那样在求学大概进行时才会来去自如。发挥出宏伟的潜力,价值最大化。不要拿本身的短板去和外人的优势比拼。

function onloadHandler()
{
   var canvas = document.getElementById('canvas');
   canvas.width = window.innerWidth;
   canvas.height = window.innerHeight;
   var k3dmain = new K3D.Controller(canvas, true);

   // generate 3D objects

   var obj1 = new K3D.K3DObject();
   with (obj1)
   {
      drawmode = "solid";
      shademode = "lightsource";
      sortmode = "unsorted";
      addphi = -0.5;
      abouty = -90;
      perslevel = 1000;
      init(
         [{x:-80,y:180,z:0},{x:0,y:180,z:-80},{x:0,y:0,z:-80},{x:-80,y:20,z:0},{x:-50,y:150,z:-30},{x:0,y:150,z:-80},{x:0,y:130,z:-80},{x:-30,y:130,z:-50},{x:-28,y:110,z:-52},{x:0,y:110,z:-80},{x:0,y:90,z:-80},{x:-45,y:90,z:-35},{x:-44,y:80,z:-36},{x:-25,y:80,z:-55},{x:-22,y:66,z:-58},{x:0,y:60,z:-80},{x:0,y:40,z:-80},{x:-40,y:50,z:-40}],
         [],
         [{color:[227,76,38],vertices:[0,1,2,3,0]},{color:[235,235,235],vertices:[4,5,6,7,8,9,10,11,4]},{color:[235,235,235],vertices:[12,13,14,15,16,17,12]}]
      );
   }
   k3dmain.addK3DObject(obj1);

   var obj2 = new K3D.K3DObject();
   with (obj2)
   {
      drawmode = "solid";
      shademode = "lightsource";
      sortmode = "unsorted";
      addphi = -0.5;
      abouty = -90;
      perslevel = 1000;
      init(
         [{x:0,y:180,z:-80},{x:80,y:180,z:0},{x:80,y:20,z:0},{x:0,y:0,z:-80},{x:0,y:165,z:-80},{x:68,y:165,z:-12},{x:55,y:35,z:-25},{x:0,y:20,z:-80},{x:0,y:150,z:-80},{x:50,y:150,z:-30},{x:47,y:130,z:-33},{x:0,y:130,z:-80},{x:0,y:110,z:-80},{x:45,y:110,z:-35},{x:40,y:50,z:-40},{x:0,y:40,z:-80},{x:0,y:60,z:-80},{x:20,y:66,z:-60},{x:23,y:90,z:-57},{x:0,y:90,z:-80}],
         [],
         [{color:[227,76,38],vertices:[0,1,2,3,0]},{color:[240,101,41],vertices:[4,5,6,7,4]},{color:[235,235,235],vertices:[8,9,10,11,8]},{color:[235,235,235],vertices:[12,13,14,15,16,17,18,19,12]}]
      );
   }
   k3dmain.addK3DObject(obj2);

   var obj3 = new K3D.K3DObject();
   with (obj3)
   {
      drawmode = "solid";
      shademode = "lightsource";
      sortmode = "unsorted";
      addphi = -0.5;
      abouty = -90;
      perslevel = 1000;
      init(
         [{x:80,y:180,z:0},{x:0,y:180,z:80},{x:0,y:0,z:80},{x:80,y:20,z:0},{x:50,y:150,z:30},{x:0,y:150,z:80},{x:0,y:130,z:80},{x:30,y:130,z:50},{x:28,y:110,z:52},{x:0,y:110,z:80},{x:0,y:90,z:80},{x:45,y:90,z:35},{x:44,y:80,z:36},{x:25,y:80,z:55},{x:22,y:66,z:58},{x:0,y:60,z:80},{x:0,y:40,z:80},{x:40,y:50,z:40}],
         [],
         [{color:[227,76,38],vertices:[0,1,2,3,0]},{color:[235,235,235],vertices:[4,5,6,7,8,9,10,11,4]},{color:[235,235,235],vertices:[12,13,14,15,16,17,12]}]
      );
   }
   k3dmain.addK3DObject(obj3);

   var obj4 = new K3D.K3DObject();
   with (obj4)
   {
      drawmode = "solid";
      shademode = "lightsource";
      sortmode = "unsorted";
      addphi = -0.5;
      abouty = -90;
      perslevel = 1000;
      init(
         [{x:0,y:180,z:80},{x:-80,y:180,z:0},{x:-80,y:20,z:0},{x:0,y:0,z:80},{x:0,y:165,z:80},{x:-68,y:165,z:12},{x:-55,y:35,z:25},{x:0,y:20,z:80},{x:0,y:150,z:80},{x:-50,y:150,z:30},{x:-47,y:130,z:33},{x:0,y:130,z:80},{x:0,y:110,z:80},{x:-45,y:110,z:35},{x:-40,y:50,z:40},{x:0,y:40,z:80},{x:0,y:60,z:80},{x:-20,y:66,z:60},{x:-23,y:90,z:57},{x:0,y:90,z:80}],
         [],
         [{color:[227,76,38],vertices:[0,1,2,3,0]},{color:[240,101,41],vertices:[4,5,6,7,4]},{color:[235,235,235],vertices:[8,9,10,11,8]},{color:[235,235,235],vertices:[12,13,14,15,16,17,18,19,12]}]
      );
   }
   k3dmain.addK3DObject(obj4);

   var objBase = new K3D.K3DObject();
   with (objBase)
   {
      drawmode = "solid";
      shademode = "lightsource";
      sortmode = "unsorted";
      addphi = -0.5;
      abouty = -90;
      perslevel = 1000;
      init(
         [{x:0,y:0,z:-80},{x:-80,y:20,z:0},{x:0,y:0,z:80},{x:80,y:20,z:0}],
         [],
         [{color:[227,76,38],vertices:[0,2,1,0]},{color:[227,76,38],vertices:[0,3,2,0]}]
      );
   }
   k3dmain.addK3DObject(objBase);

   var objHtml = new K3D.K3DObject();
   with (objHtml)
   {
      drawmode = "solid";
      shademode = "lightsource";
      //sortmode = "unsorted";
      color = [64,64,64];
      doublesided = true;
      addphi = -0.5;
      abouty = 100;
      scale = 0.75;
      perslevel = 1000;
      init(
         [{x:-80,y:40,z:0},{x:-70,y:40,z:0},{x:-70,y:30,z:0},{x:-60,y:30,z:0},{x:-60,y:40,z:0},{x:-50,y:40,z:0},{x:-50,y:10,z:0},{x:-60,y:10,z:0},{x:-60,y:20,z:0},{x:-70,y:20,z:0},{x:-70,y:10,z:0},{x:-80,y:10,z:0},{x:-40,y:40,z:0},{x:-10,y:40,z:0},{x:-10,y:30,z:0},{x:-20,y:30,z:0},{x:-20,y:10,z:0},{x:-30,y:10,z:0},{x:-30,y:30,z:0},{x:-40,y:30,z:0},{x:0,y:40,z:0},{x:10,y:40,z:0},{x:20,y:30,z:0},{x:30,y:40,z:0},{x:40,y:40,z:0},{x:40,y:10,z:0},{x:30,y:10,z:0},{x:30,y:30,z:0},{x:20,y:20,z:0},{x:10,y:30,z:0},{x:10,y:10,z:0},{x:0,y:10,z:0},{x:50,y:40,z:0},{x:60,y:40,z:0},{x:60,y:20,z:0},{x:80,y:20,z:0},{x:80,y:10,z:0},{x:50,y:10,z:0}],
         [],
         [{vertices:[0,1,2,3,4,5,6,7,8,9,10,11,0]},{vertices:[12,13,14,15,16,17,18,19,12]},{vertices:[20,21,22,23,24,25,26,27,28,29,30,31,20]},{vertices:[32,33,34,35,36,37,32]}]
      );
   }
   k3dmain.addK3DObject(objHtml);

   // add render loop callback
   var ctx = canvas.getContext('2d');
   var rotationOffset = 0;
   var len = (canvas.height > canvas.width ? canvas.height : canvas.width) * 0.7;
   k3dmain.clearBackground = false;
   k3dmain.callback = function()
   {
      // manually clear bg - as we want to render some extra goodies
      ctx.clearRect(0, 0, canvas.width, canvas.height);

      // draw bg effect before K3D does its 3D rendering
      ctx.save();
      ctx.translate(canvas.width/2, canvas.height/2);
      ctx.rotate(rotationOffset);

      // first fill pass - outer rays
      var RAYCOUNT = 24;
      ctx.fillStyle = "#eee";
      ctx.beginPath();
      for (var i=0; i<RAYCOUNT; i++)
      {
         // rotate context
         ctx.rotate(TWOPI / RAYCOUNT);
         ctx.moveTo(0, 0);
         ctx.lineTo(-20, len);
         ctx.lineTo(20, len);
      }
      ctx.closePath();
      ctx.fill();
      // second fill pass - inner rays
      ctx.fillStyle = "#fff";
      ctx.beginPath();
      for (var i=0; i<RAYCOUNT; i++)
      {
         // rotate context
         ctx.rotate(TWOPI / RAYCOUNT);
         ctx.moveTo(0, 0);
         ctx.lineTo(-15, len);
         ctx.lineTo(15, len);
      }
      ctx.closePath();
      ctx.fill();
      ctx.restore();
      rotationOffset += 0.005;

      // apply user interaction to rotation
      for (var i=0, objs=k3dmain.objects; i<objs.length; i++)
      {
         objs[i].ophi += targetRotationX;
      }

      if (targetRotationX > -0.5) targetRotationX -= 0.05;
      else if (targetRotationX < -0.55) targetRotationX += 0.05;
      if (targetRotationX > -0.55 && targetRotationX < -0.5) targetRotationX = -0.5;
   };

   // start demo loop
   k3dmain.paused = true;
   setInterval(function(){k3dmain.tick()}, 1000/60);
}

葡京在线开户 6

那有的代码是成套动画的初叶化代码,在那之中我们选拔了k三d的脚本库,所以你必要在类型中引用它,关于k3d,你可以在最终的源代码中找到它。

创设条件:在这些群众立异的条件中,一定要有所成立,不可见在去重新轻巧的行事,乃至是体力劳动。创建性有二种表现情势:1是发明,2是发掘。创建性以成立性思维为主题,创制性思维又以分流思维为主导。不要去报考未有创制性专门的学业所对应的正经。

<script src="k3d-min.js"></script>

葡京在线开户 7

上面是部分鼠标事件,你可以拖动鼠标来让其旋转,具体代码如下:

利润原则:学习某专门的学业,现在的前途一定是光明的,一定是适应社会发展的,一定要能够凭它生活下去,最次也要消除温饱难点,最佳的举例说将在像是站在风口上的猪。即便某正式,并不可见让您凭它生存,以至是流浪街头。这将是一种精神毁灭,会一步步粉碎身体。

function onDocumentMouseDown( event ) {

    event.preventDefault();

    document.addEventListener('mousemove', onDocumentMouseMove, false);
    document.addEventListener('mouseup', onDocumentMouseUp, false);
    document.addEventListener('mouseout', onDocumentMouseOut, false);

    mouseXOnMouseDown = event.clientX - windowHalfX;
    targetRotationOnMouseDownX = targetRotationX;
    mouseYOnMouseDown = event.clientY - windowHalfY;
    targetRotationOnMouseDownY = targetRotationY;
}

function onDocumentMouseMove( event )
{
    mouseX = event.clientX - windowHalfX;
    targetRotationX = targetRotationOnMouseDownX + (mouseX - mouseXOnMouseDown) * 0.02;
    mouseY = event.clientY - windowHalfY;
    targetRotationY = targetRotationOnMouseDownY + (mouseY - mouseYOnMouseDown) * 0.02;
}

function onDocumentMouseUp( event )
{
    document.removeEventListener('mousemove', onDocumentMouseMove, false);
    document.removeEventListener('mouseup', onDocumentMouseUp, false);
    document.removeEventListener('mouseout', onDocumentMouseOut, false);
}

function onDocumentMouseOut( event )
{
    document.removeEventListener('mousemove', onDocumentMouseMove, false);
    document.removeEventListener('mouseup', onDocumentMouseUp, false);
    document.removeEventListener('mouseout', onDocumentMouseOut, false);
}

function onDocumentTouchStart( event )
{
    if (event.touches.length == 1)
    {
        event.preventDefault();

        mouseXOnMouseDown = event.touches[0].pageX - windowHalfX;
        targetRotationOnMouseDownX = targetRotationX;
        mouseYOnMouseDown = event.touches[0].pageY - windowHalfY;
        targetRotationOnMouseDownY = targetRotationY;
    }
}

葡京在线开户 8

好了,二个粗略的3D动画完结起来依然有点复杂的,你能够下载源代码来研讨学习。源码下载>>

高考志愿填报的好

不是因为高等高校统招考试战表高

而是因为他们有行业内部的发问顾问

老满说高等学校统招考试

非可是高等高校统招考试志愿专家

更进一步国家生涯规划师

葡京在线开户 9

江山生涯规划师,有名高等学校统招考试志愿规划大家,老满说高等高校统一招生考试开创者,中华夏族民共和国教育在线、高考金刊、新东方、百度、天涯论坛等楼台湾特务聘高等高校统招考试咨询专家。多年从事中学生涯规划和高考志愿填报引导专门的学问,经验丰裕。满先生教您报志愿公号mlsgkbk,擅长依照考生的欣赏、兴趣、特长和对前景的专门的学业规划,量身塑造合适的自觉填报方案。数十次赴约进行大型高等高校统招考试志愿填报类别讲座,数八千0考生和老人家收益。方今先后引导近千名考生进入卓绝的院所和规范,相当受考生及老人好评。