<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <style> body { width: 100%; height: 100%; } * { margin: 0; padding: 0; } .label { font-size: 20px; color: #000; font-weight: 700; } .circle { width: 20px; height: 20px; border-radius: 10px; position: absolute; left: 0; top: 0; background-color: red; z-index: 1000; } #container { position: relative; width: 100%; height: 100vh; } </style> </head> <body> <div class="circle"></div> <div id="container"></div>...
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Articles by axesHelper Word
ThreeJS-3D教学七-交互_天外天-亮的博客-CSDN博客
在threejs中想要选中一个物体,点击或者鼠标悬浮,又或者移动端的touch事件,核心都是通过new THREE.Raycaster完成的。这里用到了一个概念,即我们点击时的 屏幕坐标 转换为 three中的3D坐标。 先看效果图: 代码是: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <style> body { width: 100%; height: 100%; } * { margin: 0; padding: 0; } .label { font-size: 20px; color: #000; font-weight: 700; } </style> </head> <body> <div id="container"></div> <script type="importmap"> { "imports": { "three": "../three-155/build/three.module.js", "three/addons/":...
ThreeJS-3D教学六-物体位移旋转-CSDN博客
之前文章其实也有涉及到这方面的内容,比如在ThreeJS-3D教学三:平移缩放+物体沿轨迹运动这篇中,通过获取轨迹点物体动起来,其它几篇文章也有旋转的效果,本篇我们来详细看下,另外加了tween.js知识点,tween可以很好的协助 three 做动画,与之相似的还有 gsap.js方法类似。 1、物体位移两种方式 mesh.position.set(x, y, z); mesh.position.x = 10; mesh.position.y = 10; mesh.position.z = 10; 2、物体旋转两种方式 // 绕局部空间的轴旋转这个物体 mesh.rotateX = 0.1; // 以弧度为单位旋转的角度 mesh.rotateY = 0.1; mesh.rotateZ = 0.1; // 物体的局部旋转,以弧度来表示 mesh.rotation.x = MathUtils.degToRad(90) // 在局部空间中绕着该物体的轴来旋转一个物体 mesh.rotateOnAxis(new Vector3(1,0,0), 3.14);...
ThreeJS-3D教学五-材质_天外天-亮的博客-CSDN博客
我们在ThreeJS-3D教学二:基础形状展示中有简单介绍过一些常用的材质,这次我们举例来具体看下效果: 代码是这样的: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <style> body { width: 100%; height: 100%; } * { margin: 0; padding: 0; } .label { font-size: 20px; color: #000; font-weight: 700; } </style> </head> <body> <div id="container"></div> <script type="importmap"> { "imports": { "three": "../three-155/build/three.module.js", "three/addons/": "../three-155/examples/jsm/" } } </script> <script...
ThreeJS-3D教学四-光源_天外天-亮的博客-CSDN博客
three模拟的真实3D环境,一个非常炫酷的功能便是对光源的操控,之前教学一中已经简单的描述了多种光源,这次咱们就详细的讲下一些最常见的光源: AmbientLight 该灯光在全局范围内平等地照亮场景中的所有对象。 该灯光不能用于投射阴影,因为它没有方向。 AmbientLight( color : Integer, intensity : Float ) color - (可选)颜色的RGB分量的数值。默认值为0xffffff。 intensity - (可选)灯光强度/强度的数值。默认值为1。 DirectionalLight 向特定方向发射的光。这种光的行为就像它是无限遥远的,并且从它产生的光线都是平行的。这方面的常见用例是模拟日光;太阳离得足够远,它的位置可以被认为是无限的,所有来自它的光线都是平行的。 DirectionalLight( color : Integer, intensity : Float ) color - (可选)灯光的十六进制颜色。默认值为0xffffff(白色)。 intensity - (可选)灯光强度/强度的数值。默认值为1。...
ThreeJS-3D教学一基础场景创建_天外天-亮的博客-CSDN博客
Three.js 是一个开源的 JS 3D 图形库,用于创建和展示高性能、交互式的 3D 图形场景。它建立在 WebGL 技术之上,并提供了丰富的功能和工具,使开发者可以轻松地构建令人惊叹的 3D 可视化效果。 Three.js 提供了一套完整的工具和 API,用于创建和管理 3D 场景、几何体、纹理、光照、材质和相机等方面。它具有强大的渲染引擎,可以处理复杂的渲染任务,如阴影、透明度、反射和折射等效果。该库还支持动画、骨骼动画、粒子系统和物理模拟,可以实现流畅的动态效果和交互行为。它提供了丰富的控制器和用户交互工具,如旋转、缩放、平移和点击等操作。 Three.js 还支持加载和导入各种文件格式,如 OBJ、STL、FBX 和 glTF 等,以便使用外部工具创建和编辑 3D 模型。它还可以与音频、视频和其他 Web 技术进行集成,实现更丰富的应用场景。...
ThreeJS-3D教学二基础形状展示_天外天-亮的博客-CSDN博客
three中提供了22 个基础模型,此案例除了 EdgesGeometry、ExtrudeGeometry、TextGeometry、WireframeGeometry,涵盖 17 个形状。 Fog 雾化设置,这是scene场景效果 EdgesGeometry , WireframeGeometry 更多地可能作为辅助功能去查看几何体的边和线框 ExtrudeGeometry 则是将一个二维图形沿 z 轴拉伸出一个三维图形 TextGeometry 则需要从外部加载特定格式的字体文件(可在 typeface.js_three 网站上进行转换)进行渲染,其内部依然使用 ExtrudeGeometry 对字体进行拉伸,从而形成三维字体。另外,该类字体的本质是一系列类似SVG 的指令。所以,字体越简单(如直线越多),就越容易被正确渲染。 planeGeometry 底层 BoxGeometry(长方体) CircleGeometry(圆形) ConeGeometry(圆锥体) CylinderGeometry(圆柱体) DodecahedronGeometry(十二面体)...
Show More
loading
Actions
Is this you?
As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.Get in touch with axesHelper
Contact axesHelper, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack