上一页 1 2 3 4 5 6 ··· 9 下一页
摘要: 效果图: let center = this.cube.position.clone(), size = this.cube.geometry.boundingBox.getSize(), scale = this.cube.scale; let heightStr = "长度:" + (size. 阅读全文
posted @ 2018-03-28 10:54 善未易明 阅读(2600) 评论(0) 推荐(0) 编辑
摘要: 例:获取cube方向上的面的中点坐标(该cube默认方向为(0,1,0)) (中心点向cube quaternion 方向上发射射线,与正前方的面相交的点即为目标点; 由于ray只支持box和face,所以需要先生成与cube相同的box) let center = cube.position.cl 阅读全文
posted @ 2018-03-28 10:47 善未易明 阅读(1070) 评论(0) 推荐(0) 编辑
摘要: interface LogEntry { data: any time: Date } export class PersistantLog { //最大条数 maxEntries = 3000; isEnabled = false; name = "default_log"; localStora 阅读全文
posted @ 2018-03-28 10:24 善未易明 阅读(370) 评论(0) 推荐(0) 编辑
摘要: function objectEquals(object1: Object, object2: Object): boolean { for (let propName in object1) { if (object1.hasOwnProperty(propName) != object2.hasOwnProperty(propName)) { return false... 阅读全文
posted @ 2018-03-28 10:18 善未易明 阅读(795) 评论(0) 推荐(0) 编辑
摘要: let positions = new Float32Array(points.length * 3); let colors = new Float32Array(points.length * 3); */ 处理positions和colors /* let bufferGeometry=new 阅读全文
posted @ 2018-03-28 10:12 善未易明 阅读(11016) 评论(1) 推荐(0) 编辑
摘要: 以后端传送threejs中的点阵数组为例: 后端: let buffer = Buffer.alloc((points.length + 4) * 4) //points.length + 4:预留前四个数字为其他信息(比如两个数字为一组,或者三个数字为一组) //预留位置 buffer.write 阅读全文
posted @ 2018-03-28 10:00 善未易明 阅读(6953) 评论(0) 推荐(0) 编辑
摘要: 1.用ssh登录远程ubuntu主机 (主机ip为:1.2.3.4;用户名:username) ssh username@1.2.3.4 2.从远程ubuntu主机copy文件/文件夹到本地(scp) (远程文件夹位置:/home/username/test.txt;本地保存目录为: .(当前目录) 阅读全文
posted @ 2018-03-28 09:45 善未易明 阅读(4388) 评论(0) 推荐(0) 编辑
摘要: 将文本或者JS字符串信息借助Blob转换成二进制,作为<a>元素的href属性,配合download属性,实现下载 对于非文本文件使用base64转换 阅读全文
posted @ 2018-02-10 10:02 善未易明 阅读(534) 评论(0) 推荐(0) 编辑
摘要: 本质为buffer转base64 let bytes = new Uint8Array(imageBuffer.data); let data = ""; let len = bytes.byteLength; for (let i = 0; i < len; i++) { data += Stri 阅读全文
posted @ 2018-01-22 17:52 善未易明 阅读(4370) 评论(0) 推荐(0) 编辑
摘要: 屏幕坐标转世界坐标: let pX = (screenPoint.x / this.scene.renderer.domElement.clientWidth) * 2 - 1; let pY = - (screenPoint.y / this.scene.renderer.domElement.c 阅读全文
posted @ 2018-01-18 11:46 善未易明 阅读(14215) 评论(2) 推荐(1) 编辑
上一页 1 2 3 4 5 6 ··· 9 下一页