随笔分类 -  three.js

模型按一个圈摆放(10等分)
摘要:var R = 320; function setPosition(){ pivot2.position.x = - Math.sin(Math.PI/5)*R; pivot2.position.z = Math.cos(Math.PI/5)*R; pivot2.rotation.z = -Math 阅读全文

posted @ 2020-03-14 18:01 chenyi4 阅读(399) 评论(0) 推荐(0) 编辑

y = n*x 匀速,变速运动
摘要:y = x ; y = 变量 * x 变速运动/匀速运动,运用 红色的小球是 y2 = x2 -2Rx; 物体绕圆形做圆周运动 上面的连接里面已经详细的写了计算方式了,就是第一个错误版本 红色小球的最开始高度的增速是远远高于紫色小球的,但是增速降低,到顶点的速度是0,然后再以低于紫色小球的速度向x轴 阅读全文

posted @ 2020-03-12 22:42 chenyi4 阅读(200) 评论(0) 推荐(0) 编辑

物体绕圆形做圆周运动
摘要:1.这是个错误的版本,方案1 下半圆,下半圆只要倒一下。y = -开平方(2*RX - X平方),图上画漏了一个X; 然后运动是有卡顿的,所以我换了一个方案。 代码 x能控制横轴的运动速度 var x = 0,y; var r = 200; var isBack = false; var speed 阅读全文

posted @ 2020-03-12 20:47 chenyi4 阅读(536) 评论(0) 推荐(0) 编辑

three.js 相机跟随鼠标移动
摘要:相机跟随鼠标移动 代码 var startY,endY; var isDown = false; var changeBefore = 0; function addTouchListener() { document.onmousedown = function (event) { startY 阅读全文

posted @ 2020-03-11 21:48 chenyi4 阅读(2493) 评论(0) 推荐(2) 编辑

three.js 物体随鼠标移动
摘要:代码 var startX,endX; var isDown = false; var changeBefore = 0; function addTouchListener() { document.onmousedown = function (event) { startX = event.c 阅读全文

posted @ 2020-03-11 21:34 chenyi4 阅读(900) 评论(0) 推荐(0) 编辑

three.js 移动模型到坐标0,0,0的位置
该文被密码保护。

posted @ 2020-03-10 22:08 chenyi4 阅读(0) 评论(0) 推荐(0) 编辑

three.js 辅助线添加,参考线,坐标轴
该文被密码保护。

posted @ 2020-03-10 21:10 chenyi4 编辑

three.js 画正多边形-线性
摘要:1.正三角形 function initLine(){ geometry = new THREE.Geometry(); var material = new THREE.LineBasicMaterial({vertexColors:true}); var p1 = new THREE.Vecto 阅读全文

posted @ 2020-03-10 20:45 chenyi4 阅读(826) 评论(0) 推荐(0) 编辑

three.js 加载 obj模型
摘要:mtl文件 模型的材质信息,比如模型颜色、透明度等信息,还有纹理贴图的路径,比如颜色贴图、法线贴图、高光贴图等等。 obj 模型 2进制模型文件 https://threejs.org/ js 文件去官网下载就行了 其他代码普通的一样就省略了 官方文档: https://threejs.org/do 阅读全文

posted @ 2020-03-09 22:20 chenyi4 阅读(8320) 评论(1) 推荐(0) 编辑

下载别人的3D模型文件
摘要:下面是我找的资源 https://wow.techbrood.com/uploads/160601/obj/banana.obj https://threejs.org/examples/models/obj/male02/male02.obj http://game.gtimg.cn/images 阅读全文

posted @ 2020-03-09 22:08 chenyi4 阅读(254) 评论(0) 推荐(0) 编辑

vue 中引入 three.js
摘要:1. npm install three --save-dev 2.在模块里面加入 <div id="info"></div> 3. import * as THREE from 'three' import image from '@/assets/image/earth.jpg' created 阅读全文

posted @ 2020-03-05 16:12 chenyi4 阅读(5519) 评论(0) 推荐(0) 编辑

three.js-地球贴图-TextureLoader
摘要:纹理贴图 <!DOCTYPE html> <html lang="en"> <head> <title>three.js webgl - cameras</title> <meta charset="utf-8"> <meta name="viewport" content="width=devic 阅读全文

posted @ 2020-03-05 14:33 chenyi4 阅读(3273) 评论(0) 推荐(2) 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

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