three.js贴图
使用图像作为材质。这时候,就需要导入图像作为纹理贴图,并添加到相应的材质中
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<script type="text/javascript" src="libs/three.js"></script> <script type="text/javascript">
function init() {
var renderer = new THREE.WebGLRenderer({
canvas: document.getElementById('mainCanvas')
});
renderer.setClearColor(0x000000);
var scene = new THREE.Scene(); // camera
var camera = new THREE.OrthographicCamera(-10, 10, 7.5, -7.5, 0.1, 100);
camera.position.set(25, 25, 25);
camera.lookAt(new THREE.Vector3(0, 0, 0));
scene.add(camera); // light
var light = new THREE.PointLight(0xffffff, 1, 1000);
light.position.set(10, 15, 20);
scene.add(light);
//如果没有重绘函数,就需要在完成导入纹理的步骤后,重新绘制画面,这是在回调函数中实现
var texture = THREE.ImageUtils.loadTexture('img/0.png', {}, function() {//将图片导入到纹理中
renderer.render(scene, camera);
});
var material = new THREE.MeshLambertMaterial({//将材质的map属性设置为texture:
map: texture
}); var cube = new THREE.Mesh(new THREE.CubeGeometry(5, 5, 5), material);
scene.add(cube);
//var sphere = new THREE.Mesh(new THREE.SphereGeometry(5, 25, 15), material);
//scene.add(sphere); renderer.render(scene, camera);
}
</script>
</head> <body onload="init()">
<canvas id="mainCanvas" width="400px" height="300px" ></canvas>
</body>
</html>
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVEAAAD/CAIAAADHdXI/AAAgAElEQVR4nO2dZ1sbSdq2OyigiCRAQoDIQVlkMAKRcza2wZGMAJGxZ+wZzzz7PJPsMY6zs2F2d/b9qe+HFlKr1Ypdkhyu86iPc8yBWj7rKt13VTVFAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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KFfhIAfElIbNpLDPlCf3oAvlSyPnKbdcgX+hMD8MWT3ZHb5CGfaLNtoT8rAOCaTLt3mYW8H7YD8FGSfvcujZB3w3YAPg3S0T6dkC/05wAApE3K7l3KkC/0JwAAZE6Se7KTtOgK/VcDAKQhqr2o8IX+SwEA5BB07wTOF/qvAwDkAP4PewgPwJcCpz1sBwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAk+P8kwYn995PxxwAAAABJRU5ErkJggg==" alt="" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<script type="text/javascript" src="libs/three.js"></script> <script type="text/javascript">
function init() {
var renderer = new THREE.WebGLRenderer({
canvas: document.getElementById('mainCanvas')
});
renderer.setClearColor(0x000000);
var scene = new THREE.Scene(); // camera
var camera = new THREE.OrthographicCamera(-10, 10, 7.5, -7.5, 0.1, 100);
camera.position.set(25, 25, 25);
camera.lookAt(new THREE.Vector3(0, 0, 0));
scene.add(camera); // light
var light = new THREE.PointLight(0xffffff, 1, 1000);
light.position.set(10, 15, 20);
scene.add(light); var materials = [];
for (var i = 0; i < 6; ++i) {//导入图像到六个纹理,并设置到六个材质中
materials.push(new THREE.MeshBasicMaterial({
map: THREE.ImageUtils.loadTexture('img/' + i + '.png', {}, function() {
renderer.render(scene, camera);
}),
overdraw: true
}));
} var cube = new THREE.Mesh(new THREE.CubeGeometry(5, 5, 5),
new THREE.MeshFaceMaterial(materials));
scene.add(cube); renderer.render(scene, camera);
}
</script>
</head> <body onload="init()">
<canvas id="mainCanvas" width="400px" height="300px" ></canvas>
</body>
</html>
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAWYAAAERC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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoIX+H+J5/QWduCbNAAAAAElFTkSuQmCC" alt="" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<script type="text/javascript" src="libs/three.js"></script> <script type="text/javascript">
function init() {
var renderer = new THREE.WebGLRenderer({
canvas: document.getElementById('mainCanvas')
});
//renderer.setClearColor(0x666666);
var scene = new THREE.Scene(); // camera
var camera = new THREE.OrthographicCamera(-10, 10, 7.5, -7.5, 0.1, 100);
camera.position.set(0, 0, 25);
camera.lookAt(new THREE.Vector3(0, 0, 0));
scene.add(camera); // light
var light = new THREE.PointLight(0xffffff, 1, 1000);
light.position.set(10, 15, 20);
scene.add(light); var texture = THREE.ImageUtils.loadTexture('img/chess.png', {}, function() {
renderer.render(scene, camera);
});
texture.wrapS = texture.wrapT = THREE.RepeatWrapping;//指定重复方式为两个方向(wrapS和wrapT)都重复
texture.repeat.set(4, 4);//,设置两个方向上都重复4次,由于我们的图像本来是有2行2列,所以重复4次即为8行8列
var material = new THREE.MeshLambertMaterial({
map: texture
}); var plane = new THREE.Mesh(new THREE.PlaneGeometry(12, 12), material);
scene.add(plane); renderer.render(scene, camera);
}
</script>
</head> <body onload="init()">
<canvas id="mainCanvas" width="400px" height="300px" ></canvas>
</body>
</html>
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAWEAAAEdCAIAAABSfUE6AAAgAElEQVR4nO3daXPbOpYG4K4aL/3zu7J0nMR2bK1etNiyLNmW5S3xmsXJTW7uTWam56/MB5ZRMAGCIID3QDTP+yFF6fZw8MF8dEgCOP/4B4fD4XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgc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<head>
<script type="text/javascript" src="libs/three.js"></script> <script type="text/javascript">
function init() {
var renderer = new THREE.WebGLRenderer({
canvas: document.getElementById('mainCanvas')
});
renderer.setClearColor(0x000000);
var scene = new THREE.Scene(); // camera
var camera = new THREE.OrthographicCamera(-2.5, 2.5, 1.875, -1.875, 0.1, 100);
camera.position.set(5, 5, 20);
camera.lookAt(new THREE.Vector3(0, 0, 0));
scene.add(camera); var material = new THREE.MeshLambertMaterial({
color: 0xffff00
});
var geometry = new THREE.CubeGeometry(1, 2, 3);
var mesh = new THREE.Mesh(geometry, material);//把几何形状与材质传入其构造函数
scene.add(mesh); var light = new THREE.DirectionalLight(0xffffff);
light.position.set(20, 10, 5);
scene.add(light); // render
renderer.render(scene, camera);
}
</script>
</head> <body onload="init()">
<canvas id="mainCanvas" width="400px" height="300px" ></canvas>
</body>
</html>
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAXYAAAEgCAIAAAAv68/YAAAGT0lEQVR4nO3U0Y0UWRQE0TELr9ZkXNmPXQmBgGGa7omqfOfoWnCljLc3AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAICP+uefRw7gfY/1RZWA931mX1QJzpLnQ5VgVh6C5L5+rf8OJ8inXvVFYuDl8qmHfZEYeK186m1fJAZeKJ963heJgVfJp36FvkgMvEQ+9Yv0RWLg+fKpX6cvEgNPlk/9Un2RGHiafOcX7IvEwHPkO79mXyQGniDf+WX7IjHwt/KdX7kvEgN/Jd/5xfsiMfC4fOfX74vEwIPynd+iLxIDj8h3fpe+SAx8WL7zu8RFYuDD8qnfqy8SAx+QT/12fZEY+FP51O/YF4mBP5JP/aZ9kRh4Xz71+/ZFYuAd+dRv3ReJgd/Jp373vkgM/FI+9YG+SAz8RL7zmb5IDPwo3/lSXyQGvpPvfKwvEgPf5Dvf64vEwP/ynU/2RWLg7U1fJAZeJ9/5cF8khtPlOx+Oi8Rwunzq832RGM6VT/2EvkgMh8qnfkh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yfPkSIzEsy5cvMRLDsnz5EqMvLMuXLzH6wrJ8+RKjLyzLly8x+sKyfPkSoy8sy5cvMfrCsnz5EgPL8uUfnhgYly//2MTAEfLln5kYOEW+/AMTAwfJl39aYuAs+fKPSgwcJ1/+OYmBE+XLPyQxcKh8+SckBs6VL38+MXC0fPnbiYHT5csfTgzQL381McDbm8ToC7xUvvy9xADf5MsfSwzwnXz5S4kBfpQvfyMxwM/lyx9IDPBL+fLvnhjgd/Ll3zoxwDvy5d83McD78uXfNDHAH8mXf8fEAH8qX/7tEgN8QL78eyUG+Jh8+TdKDPBh+fLvkhjgEfnyb5EY4EH58q+fGOBx+fIvnhjgr+TLv3JigL+VL/+yiQGeIF/+NRMDPEe+/KslBnimfPmXSgzwZPnyr5MY4Pny5V8kMcBL5Mu/QmKAV8mXnycGeKF8+W1igNfKlx8mBni5fPlVYoBe3oUXJQa4qzwl7yYGOMtnJgbgfY8lBgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADe/gWR03ZA0V3CMwAAAABJRU5ErkJggg==" alt="" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<script type="text/javascript" src="libs/three.js"></script> <script type="text/javascript">
function init() {
var renderer = new THREE.WebGLRenderer({
canvas: document.getElementById('mainCanvas')
});
renderer.setClearColor(0x000000);
var scene = new THREE.Scene(); // camera
var camera = new THREE.OrthographicCamera(-2.5, 2.5, 1.875, -1.875, 0.1, 100);
camera.position.set(5, 5, 20);
camera.lookAt(new THREE.Vector3(0, 0, 0));
scene.add(camera); var material = new THREE.MeshLambertMaterial({
color: 0xffff00
});
var geometry = new THREE.CubeGeometry(1, 2, 3);
var mesh = new THREE.Mesh(geometry, material);
scene.add(mesh); mesh.material = new THREE.MeshLambertMaterial({
color: 0xff0000
}); var light = new THREE.DirectionalLight(0xffffff);
light.position.set(20, 10, 5);
scene.add(light); // render
renderer.render(scene, camera);
}
</script>
</head> <body onload="init()">
<canvas id="mainCanvas" width="400px" height="300px" ></canvas>
</body>
</html>
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZMAAAE6CAIAAABcbSgQAAAJSklEQVR4nO3U0bEYBxFFwReWsyJkQjEfUBiEbEnPRvfMbnfdAKbm43z8CnDNx/oAgB+mXMA9ygXco1zAPcoF3KNcwD3KBdzzW7k+AK5QLuAe5QLuUS7gHuUC7lEu4B7lAu5RLuAe5QLuUS7gHuUC7lEu4B7lAu5RLuAe5QLuUS7gHuUC7lEu4B7lAu5RLuAe5QLuUS7gHuUC7lEu4B7lAu5RLuAe5QLuUS7gHuUC7lEu4B7lAu5RLuAe5QLuUS7gHuUC7lEu4B7lAu5RLuAe5QLuUS7gHuUC7lEu4B7lAu5RLv6Mv31q8GcpF5/2uWyJHX8B5eJzfma2xI4vKRefMK+S2L2dcvGj5n2Z7O/rt/NflIsfMi/IKlvK1aJcfL95QYbZUq4W5eI7zQuyzZZytSgX32NekHm2lKtFufimeUEK2VKuFuXij80LEsmWcrUoF39gXpBOtpSrRbn4PfOCpLKlXC3Kxf+a5yOYLeVqUS6+MM9HM1vK1aJc/Kd5PrLZUq4W5eLf5vkoZ0u5WpSLf5rnI54t5WpRLj7W7TiRLeVqUS7m+TiRLeVqUa6Xm+fjSraUq0W53myejyvNUq4c5XqteUFuZUu5WpTrneYFOZct5WpRrheaF+RitpSrRbneZl6Qo9lSrhblepV5Qe5mS7lalOs95gU5nS3lalGul5gX5Hq2lKtFud5gXpAHZEu5WpTr2eb5eEy2lKtFuR5sno8nZUu5WpTrqeb5eFi2lKtFuR5pno/nZUu5WpTreeb5eGS2lKtFuR5mno+nZku5WpTrSeb5eHC2lKtFuR5jno8HN0u5cpTrGeYFeXy2lKtFuR5gXpA3ZEu5WpTrunlBXpIt5WpRrtPmBXlPtpSrRbnumhfkVdlSrhblOmpekLdlS7lalOuieUFemC3lalGuc+YFeWe2lKtFuQ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B7lAu4R7mAe34FuEa5gHuUC7hHuYB7lAu4R7mAe/4B7awc8vt2fsEAAAAASUVORK5CYII=" alt="" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<script type="text/javascript" src="libs/three.js"></script> <script type="text/javascript">
function init() {
var renderer = new THREE.WebGLRenderer({
canvas: document.getElementById('mainCanvas')
});
renderer.setClearColor(0x000000);
var scene = new THREE.Scene(); // camera
var camera = new THREE.OrthographicCamera(-2.5, 2.5, 1.875, -1.875, 0.1, 100);
camera.position.set(5, 5, 20);
camera.lookAt(new THREE.Vector3(0, 0, 0));
scene.add(camera); var material = new THREE.MeshLambertMaterial({
color: 0xffff00
});
var geometry = new THREE.CubeGeometry(1, 2, 3);
var mesh = new THREE.Mesh(geometry, material);
scene.add(mesh); mesh.position.set(1.5, -0.5, 0);
mesh.position = new THREE.Vector3(1.5, -0.5, 0);
mesh.position.z = 1;//只设置其中一个属性
//如果需要同时设置多个属性,可以使用以下两种方法: mesh.position.set(1.5, -0.5, 0); var light = new THREE.DirectionalLight(0xffffff);
light.position.set(20, 10, 5);
scene.add(light); drawAxes(scene); // render
renderer.render(scene, camera);
} function drawAxes(scene) {
// x-axis
var xGeo = new THREE.Geometry();
xGeo.vertices.push(new THREE.Vector3(0, 0, 0));
xGeo.vertices.push(new THREE.Vector3(1, 0, 0));
var xMat = new THREE.LineBasicMaterial({
color: 0xff0000
});
var xAxis = new THREE.Line(xGeo, xMat);
scene.add(xAxis); // y-axis
var yGeo = new THREE.Geometry();
yGeo.vertices.push(new THREE.Vector3(0, 0, 0));
yGeo.vertices.push(new THREE.Vector3(0, 1, 0));
var yMat = new THREE.LineBasicMaterial({
color: 0x00ff00
});
var yAxis = new THREE.Line(yGeo, yMat);
scene.add(yAxis); // z-axis
var zGeo = new THREE.Geometry();
zGeo.vertices.push(new THREE.Vector3(0, 0, 0));
zGeo.vertices.push(new THREE.Vector3(0, 0, 1));
var zMat = new THREE.LineBasicMaterial({
color: 0x00ccff
});
var zAxis = new THREE.Line(zGeo, zMat);
scene.add(zAxis);
}
</script>
</head> <body onload="init()">
<canvas id="mainCanvas" width="400px" height="300px" ></canvas>
</body>
</html>
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcUAAAGECAIAAADIp6waAAAMvklEQVR4nO3Zsa0cSRZE0TaLXo2PK48P9GJVjrRAbQpvyM9MRkXVOUjlaYVG4Cr9+S8AO3zSHwDwEHoKsIeeAuzx+Q8AO3x+ALCDngLsoacAe+gpwB56CrCHngLsoacAe+gpwB7/19MPQIlUNAd6ClRKRXOgp0ClVDQHegpUSkVzoKdApVQ0B3oKVEpFc6CnQKVUNAd6ClRKRXOgp0ClVDQHegpUSkVzoKdApVQ0B3oKVEpFc6CnQKVUNAd6ClRKRXOgp0ClVDQHegpUSkVzoKdApVQ0B3oKVEpFc6CnQKVUNAd6ClRKRXOgp0ClVDQHegpUSkVzoKdApVQ0B3oKVEpFc6CnQKVUNAd6ClRKRXOgp0ClVDQHegpUSkVzoKdApVQ0B3oKVEpFc6CnQKVUNAd6ClRKRXOgp0ClVDQHegpUSkVzoKdApVQ0B3oKVEpFc6CnQKVUNAd6ClRKRXOgp0ClVDQHegpUSkVzoKdApVQ0B3oKVEpFc6CnQKVUNAd6ClRKRXOgp0ClVDQHegpUSkVzoKdApVQ0B3oKVEpFc6CnQKVUNAd6ClRKRXOgp0ClVDQHegpUSkVzoKdApVQ0B3oKVEpFc6CnQKVUNAd6ClRKRXOgp0ClVDQHegpUSkVzoKdApVQ0B3oKVEpFc6CnQKVUNAd6ClRKRXOgp0ClVDQHegpUSkVzoKdApVQ0B3oKVEpFc6CnQKVUNAd6ClRKRXOgp0ClVDQHegpUSkVzoKdApVQ0B3oKVEpFc6CnHGZWnJGK5kBPOcysOCMVzYGecphZcUYqmgM95TCz4oxUNAd6ymFmxRmpaA70lMPMijNS0RzoKYeZFWekojnQUw4zK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U4A99BRgDz0F2ENPAfbQU4A99BRgDz0F2ENPAfbQU4A99BRgDz0F2ENPAfbQU4A99BRgDz0F2ENPAfbQU4A99BRgDz0F2ENPAfbQU4A99BRgDz0F2ENPAfbQU4A99BRgDz0F2ENPAfbQU4A99BRgDz0F2ENPAfbQU4A99BRgDz0F2ENPAfbQU4A99BRgDz0F2ENPAfbQU4A99BRgDz0F2ENPAfbQU4A99BRgDz0F2ENPAfbQU4A99BRgDz0F2ENPAfbQU4A99BRgDz0F2ENPAfbQU4A99BRgDz0F2ENPAfbQU4A9/gFy+u4It9evHwAAAABJRU5ErkJggg==" alt="" />缩放对应的属性是scale,旋转对应的属性是rotation,具体方法与上例相同
three.js贴图的更多相关文章
- js正则表达式图形化工具-rline
github地址:https://github.com/finance-sh/rline 在线demo: http://lihuazhai.com/demo/test.html 这是一个js正则表达式 ...
- JS前端图形化插件之利器Gojs组件(php中文网)
JS前端图形化插件之利器Gojs组件(php中文网) 一.总结 一句话总结:php中文网我可以好好走一波 二.JS前端图形化插件之利器Gojs组件 参考: JS前端图形化插件之利器Gojs组件-js教 ...
- 最近发现了个js传图预览的函数和大家分享下
由于浏览器js沙箱,存在不同域,js无法直接调用电脑文件.在之前做传图预览的时候,基本的思路就是, 将图片先保存到服务器中缓存,然后返回一个服务器路径,并显示出图片,然而这样很耗缓存目录文件的.方法也 ...
- (转)轻量级JS焦点图/轮换图myFocus V2源码下载及安装教程
myFocus是一个专注于焦点图/轮换图制作的JS库,它小巧而且是完全独立的JS库,用它可以轻松的制作出网上绝大部分常见的焦点图(甚至包括flash焦点图),而且制作出的焦点图体积也非常的小(1KB左 ...
- [Js]焦点图轮播效果
一.所用到的知识点 1.DOM操作 2.定时器 3.事件运用 4.Js动画 5.函数递归 6.无限滚动大法 二.结构和样式 <div id="banner" class=&q ...
- 纯JS焦点图特效(可一个页面多用)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- 自己做的js甘特图插件
版权所有,禁止转载 内容都在代码中,上图上代码! 代码 <!DOCTYPE html> <html> <head> <title>ganttu.html ...
- html+JS刷图实现视频效果
网页播放视频须要载入播放器,可是通过刷图也能实现视频播放的效果 JS中用到Z-index属性,记录一篇解说Z-index属性的博客的地址: http://www.cnblogs.com/gisdrea ...
- 免费JS甘特图组件dhtmlxgantt
安装 参考:https://docs.dhtmlx.com/gantt/desktop__install_with_bower.html 可使用NuGet.Bower.npm包管理器安装(应用在asp ...
随机推荐
- MySQL主从复制原理及配置详细过程以及主从复制集群自动化部署的实现
一.复制概述 Mysql内建的复制功能是构建大型,高性能应用程序的基础.将Mysql的数据分布到多个系统上去,这种分布的机制,是通过将Mysql的某一台主机的数据复制到其它主机(slaves)上,并重 ...
- web报表工具Stimulsoft Reports.Web在mvc项目中使用
Stimulsoft Reports.Web,是一款可以直接在Web中编辑报表的报表工具 web项目技术框架mvc4+easyui+knockoutjs 1.在项目中添加引用 Stimulsoft.B ...
- 前端工具HBuilder安装Sass插件
HBuilder自带未安装的less插件,但是sass插件却没有,需要自己安装,步骤如下: 1.安装sass,参考: http://www.w3cplus.com/sassguide/install. ...
- 数据结构 浙大MOOC 笔记二 线性结构
线性表及其表现 第二章的内容是关于三种最基本的数据结构 结合<DDSA>第三章 表.栈和队列做一个总结 首先简单说明一下各个数据结构的特点: 数组:连续存储,遍历快且方便,长度固定,缺点是 ...
- connect/express 的参考
1.Node.js[5] connect & express简介 对connect中间件的分类比较容易理解. http://www.cnblogs.com/luics/archive/2 ...
- js词法分析
JavaScript的高级知识---词法分析 词法分析 词法分析方法: js运行前有一个类似编译的过程即词法分析,词法分析主要有三个步骤: 分析参数 再分析变量的声明 分析函数说明 函数在运行的瞬间, ...
- 设计模式--装饰模式Decorate(结构型)
一.装饰模式 动态地给一个对象添加额外的职责.就增加功能来说,装饰模式相比生成子类更为灵活.有时我们希望给某个对象而不是整个类添加一些功能. 二.UML图 1.Component(概念中提到的对象接口 ...
- (一)Netty源码学习笔记之概念解读
尊重原创,转载注明出处,原文地址:http://www.cnblogs.com/cishengchongyan/p/6121065.html 博主最近在做网络相关的项目,因此有契机学习netty,先 ...
- 【webGL】插件的使用的,实现一个鼠标动画的盒子
准备工作: 1.stat.js stat.js是Three.js的作者Mr. Doob的另一个有用的JavaScript库.很多情况下,我们希望知道实时的FPS信息,从而更好地监测动画效果.这时候,s ...
- Eclipse下载与安装
有很多小伙伴不知道eclipse在哪里下载以及怎么安装的,那我来给大家做个演示吧. 学习java比较常用的软件就是eclipse,而eclipse安装后并不能马上使用,还需要安装jdk并搭建环境.下面 ...