Show HN:基于 Svelte 和 Three.js 构建的 Web 3D 框架
Show HN: 3D framework for the web, built on Svelte and Three.js

原始链接: https://threlte.xyz/

Threlte 集成了 Rapier(一流的物理引擎)、Theatre.js(具有专业运动设计工具集的动画库)和 @threlte/gltf(将 GLTF 文件转换为 Threlte 组件的工具)。 threlte/extras 提供了一系列有用的组件和实用程序来帮助您入门。 Documentation @threlte/rapierCopy <script> import { RigidBody, AutoColliders } from '@threlte/rapier' import { T } from '@threlte/core' </script> <RigidBody> <AutoColliders shape={'ball'}> <T.Mesh receiveShadow castShadow> <T.SphereGeometry args={[0.25]} /> <T.MeshStandardMaterial /> </T.Mesh> </AutoColliders> </RigidBody> @threlte/extrasCopy <script> import { GLTF, Float } from '@threlte/extras' </script> <Float> <GLTF castShadow receiveShadow url={'/models/flower.glb'} position.y={1} scale={3} /> </Float>

Threlte 是一个开源项目,专注于两个主要领域:增强 Threlte 以实现 Svelte 5 兼容性和开发可视化编码编辑器 Threlte Studio。 目前,Threlte 团队正在对 Threlte 进行广泛修改,以适应 Svelte 5,提高组件效率并集成新的 Svelte 功能。 与此同时,他们正在探索创建 Threlte Studio,这是一个创新的编辑器,使用户能够直观地修改他们的代码。 此外,Threlte 仍然受到 React-Three-Fiber 等项目的启发,使用其概念为 Svelte 创建声明性 Three.js API。 加入他们的 Discord 或在 Twitter 上关注他们,随时了解他们的进展。
相关文章

原文
Threlte comes with integrations for Rapier, a best-in-class physics engine, Theatre.js, an animation library with a professional motion design toolset and @threlte/gltf, a tool to transform GLTF files into Threlte components.

On top of that @threlte/extras provides a collection of useful components and utilities to get you started. Documentation

@threlte/rapier

<script>
  import { RigidBody, AutoColliders } from '@threlte/rapier'
  import { T } from '@threlte/core'
</script>

<RigidBody>
  <AutoColliders shape={'ball'}>
    <T.Mesh receiveShadow castShadow>
      <T.SphereGeometry args={[0.25]} />
      <T.MeshStandardMaterial />
    </T.Mesh>
  </AutoColliders>
</RigidBody>

@threlte/extras

<script>
  import { GLTF, Float } from '@threlte/extras'
</script>

<Float>
  <GLTF
    castShadow
    receiveShadow
    url={'/models/flower.glb'}
    position.y={1}
    scale={3}
  />
</Float>
联系我们 contact @ memedata.com