three.js all in one

https://www.npmjs.com/package/three

# yarn add three
# OR
$ npm i three

https://github.com/mrdoob/three.js

https://threejs.org/docs/index.html#manual/en/introduction/Installation


import * as THREE from './js/three.module.js'; var camera, scene, renderer;
var geometry, material, mesh; init();
animate(); function init() {
camera = new THREE.PerspectiveCamera( 70, window.innerWidth / window.innerHeight, 0.01, 10 );
camera.position.z = 1;
scene = new THREE.Scene();
geometry = new THREE.BoxGeometry( 0.2, 0.2, 0.2 );
material = new THREE.MeshNormalMaterial();
mesh = new THREE.Mesh( geometry, material );
scene.add( mesh );
renderer = new THREE.WebGLRenderer( { antialias: true } );
renderer.setSize( window.innerWidth, window.innerHeight );
document.body.appendChild( renderer.domElement );
} function animate() {
requestAnimationFrame( animate );
mesh.rotation.x += 0.01;
mesh.rotation.y += 0.02;
renderer.render( scene, camera );
}

WebGL

canvas

old version

https://www.npmjs.com/package/three.js

# yarn add three.js
# OR
$ npm i three.js

refs



xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


最新文章

  1. Memo
  2. ASP.Net请求处理机制初步探索之旅 - Part 1 前奏
  3. springmvc处理上传图片代码(校验图片尺寸、图片大小)
  4. CI框架入门1
  5. XML转JSON
  6. MySQL的几种连接 join/inner join/cross join/逗号/left join/right join/natural join
  7. Python argparse
  8. javascript实现栈功能
  9. 关于bootstrap--列表(ol、ul)
  10. winform程序中Label自动换行
  11. 一张地图告诉你,只JavaScript不够!
  12. DotNetOpenAuth搭建OAuth2.0
  13. 在Eclipse中用TODO标签管理任务(Task)
  14. hzoj 2301(莫比乌斯反演)
  15. 热烈庆祝自已厉精13年开发的 DB查询分析器 7.01(最新版本) 在中关村在线本月获得近6000次的下载量
  16. JS 数据类型、赋值、深拷贝和浅拷贝
  17. PTA第四次作业
  18. Windows7下Jupyter Notebook使用入门
  19. 【python小工具】我在bilibili个人资料里控制家里的电脑
  20. JS Function类型

热门文章

  1. You shouldn't use *any* general-purpose hash function for user passwords, not BLAKE2, and not MD5, SHA-1, SHA-256, or SHA-3
  2. https://github.com/golang/go/wiki/CommonMistakes
  3. 阿里一面,给了几条SQL,问需要执行几次树搜索操作?
  4. 采用pandas读取文件,进行自动化统计小程序
  5. 深度学习论文翻译解析(十八):MobileNetV2: Inverted Residuals and Linear Bottlenecks
  6. Python 字符串指定位置替换字符
  7. LSTM机器学习生成音乐
  8. getline()的使用注意
  9. 2019牛客暑期多校训练营(第三场)G.Removing Stones(ST+分治)
  10. Codeforces Round #627 (Div. 3) A - Yet Another Tetris Problem(逻辑)