|
|

楼主 |
发表于 2025-6-24 13:07
|
显示全部楼层
代码
- <div id="papa" style="width: 100%;height: 600px; position: relative;"></div>
- <script type="module">
- import { THREE, scene, camera, renderer, clock, basic3 } from 'https://638183.freep.cn/638183/3dev/3/3basic.js';
- basic3(papa);
- // 加载纹理
- const texture = new THREE.TextureLoader().load('https://638183.freep.cn/638183/small/2025/aa.jpeg');
- texture.colorSpace = THREE.SRGBColorSpace;
- texture.wrapS = THREE.RepeatWrapping;
- texture.wrapT = THREE.RepeatWrapping;
- texture.repeat.x = 10;
- texture.repeat.y = 5;
- //绘制直管道
- const path = new THREE.LineCurve3(new THREE.Vector3(-2, 1, 0), new THREE.Vector3(2, -1, 0));
- const geometry = new THREE.TubeGeometry(path, 32, 0.2, 8, false);
- const material = new THREE.MeshBasicMaterial({ color: 0xefefee, map: texture });
- const mesh = new THREE.Mesh(geometry, material);
- scene.add(mesh);
- // 纹理动画
- const animate = () => {
- requestAnimationFrame(animate);
- const delta = clock.getDelta();
- texture.offset.x -= delta;
- renderer.render(scene, camera);
- };
- animate();
- </script>
复制代码
|
评分
-
| 参与人数 1 | 威望 +50 |
金钱 +100 |
经验 +50 |
收起
理由
|
红影
| + 50 |
+ 100 |
+ 50 |
赞一个! |
查看全部评分
|