three.js 郭隆邦 笔记1

http://www.webgl3d.cn/pages/cd35b2/
p3 three.js 下载官方文件包 2023
three每个月都会发布新版本
threejs官方包所有版本: https://github.com/mrdoob/three.js/releases
three.js 中文网 www.webgl3d.cn
笔记: http://www.webgl3d.cn/pages/aac9ab/

p4
本地静态服务器 webpack vite 开发环境
three.js 就用 live-server 就行
p5
vue 引入three.js(js库)
three.js 其他扩展库 examples>jsm>controls 下的都是
新版本 three>addons>controls
.html 直接引入three.js 本地静态服务打开html

<script type="module>   // 支持Es6语法
	import * as THREE from './build/three.module.js';   // 引入ES6语法的three
</script>
<script type="importmap>   // html文件和vue开发项目中写法一样  需要配置下面的路径
{
	"imports": {
		"three": "../three.js/build/three/module.js""three/addons": "../three.js/examples/jsm/"
	}
}
</script>
// 就可以向下面一样使用了
<script type="module>  
	import * as THREE from 'three';  // 和上面的three名字对应
	import { OrbitControls} from 'three/addons/controls/OrbitControls.js'
</script>

p6

你可能感兴趣的:(three.js,javascript,笔记,前端)