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