随笔分类 -  threejs

摘要:threejs 点击物体射线检测碰撞 <!DOCTYPE html> <html> <head> <title></title> <style> canvas { width: 100%; height: 100% } </style> <script src="/moban/js/three.js 阅读全文
posted @ 2021-05-07 10:59 newmiracle宇宙 阅读(1293) 评论(0) 推荐(0) 编辑
摘要:<!DOCTYPE html> <html lang="en"> <head> <title></title> <meta charset="utf-8"> <meta name="generator" content="Three.js Editor"> <meta name="viewport" 阅读全文
posted @ 2021-02-18 21:37 newmiracle宇宙 阅读(212) 评论(0) 推荐(0) 编辑
摘要:publish生成的代码没办法把自己写的事件嵌入进去 所以我想自己写事件代码可以运用上去 这样UI和事件耦合度更低 <!DOCTYPE html> <html lang="en"> <head> <title></title> <meta charset="utf-8"> <meta name="g 阅读全文
posted @ 2021-02-18 18:22 newmiracle宇宙 阅读(229) 评论(0) 推荐(0) 编辑
摘要:threejs 解决模型缩小有黑边的解决方案 var material = new THREE.MeshBasicMaterial({ map: texture1, alphaTest: 0.9, side: THREE.DoubleSide, depthWrite: false }); alpha 阅读全文
posted @ 2021-01-31 09:41 newmiracle宇宙 阅读(631) 评论(0) 推荐(1) 编辑
摘要:threejs 透明模型遮挡后面模型解决方案 var material = new THREE.MeshBasicMaterial({ map: texture1, transparent: true, side: THREE.DoubleSide, depthWrite: false }); 阅读全文
posted @ 2021-01-30 13:42 newmiracle宇宙 阅读(3060) 评论(0) 推荐(1) 编辑
摘要:threejs translateOnAxis理解 var axis = new THREE.Vector3(1,22,0);//向量axis // mesh.translateOnAxis(axis,300);//沿着axis轴表示方向平移300 注意这个地方要乘以向量的 300是对于1 阅读全文
posted @ 2021-01-25 16:00 newmiracle宇宙 阅读(986) 评论(0) 推荐(0) 编辑
摘要:threejs 正交视图详解 用正交就是因为能更好的用像素 canvaswidth = 750; canvasheight = 1206; renderer = new THREE.WebGLRenderer({ alpha: true }); renderer.setSize(canvaswidt 阅读全文
posted @ 2021-01-25 14:18 newmiracle宇宙 阅读(990) 评论(0) 推荐(0) 编辑
摘要:threejs 透明贴图的方法 function init() { //设置渲染窗口的大小 var canvaswidth=window.innerWidth; var canvasheight=window.innerHeight; renderer = new THREE.WebGLRender 阅读全文
posted @ 2021-01-25 10:06 newmiracle宇宙 阅读(2409) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示