Svelthree - 如何向场景添加边缘和线条?
Svelthree - How do I add edges and lines to a scene?
我正在尝试使用 Svelthree 为对象添加边。
我知道如何使用网格将几何体添加到场景中,但如何在几何体的边缘添加线条?
来自官方REPL (https://svelthree.dev/examples#hello-cube):
<Scene {sti} let:scene id="scene1" props={{ background: 0xedf2f7 }}>
<PerspectiveCamera {scene} id="cam1" pos={[0, 0, 3]} lookAt={[0, 0, 0]} />
<AmbientLight {scene} intensity={1.25} />
<DirectionalLight {scene} pos={[3, 3, 3]} />
<Mesh
{scene}
geometry={cubeGeometry}
material={cubeMaterial}
mat={{ roughness: 0.5, metalness: 0.5, color: 0xff3e00 }}
pos={[0, 0, 0]}
rot={[0.5, 0.6, 0]}
scale={[1, 1, 1]} />
我已经在 GitHub
上回答了你的问题
短版:
目前没有 'Line'-component 可用,但是有了 Mesh 和 Scene 实例,你基本上可以做任何你想做的香草三风格。
我正在尝试使用 Svelthree 为对象添加边。
我知道如何使用网格将几何体添加到场景中,但如何在几何体的边缘添加线条?
来自官方REPL (https://svelthree.dev/examples#hello-cube):
<Scene {sti} let:scene id="scene1" props={{ background: 0xedf2f7 }}>
<PerspectiveCamera {scene} id="cam1" pos={[0, 0, 3]} lookAt={[0, 0, 0]} />
<AmbientLight {scene} intensity={1.25} />
<DirectionalLight {scene} pos={[3, 3, 3]} />
<Mesh
{scene}
geometry={cubeGeometry}
material={cubeMaterial}
mat={{ roughness: 0.5, metalness: 0.5, color: 0xff3e00 }}
pos={[0, 0, 0]}
rot={[0.5, 0.6, 0]}
scale={[1, 1, 1]} />
我已经在 GitHub
上回答了你的问题短版:
目前没有 'Line'-component 可用,但是有了 Mesh 和 Scene 实例,你基本上可以做任何你想做的香草三风格。