Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

如何使用 Three.js 在 React.js 应用程序中实现一个 Blender 模型 #1197

Merged
merged 11 commits into from
Feb 18, 2024

Conversation

xuxuecho
Copy link
Contributor

Checklist:

Closes #1175

@miyaliu666 miyaliu666 added Review-awaiting 待校对 and removed Translation-in-progress 正在翻译 labels Feb 3, 2024
Copy link
Member

@miyaliu666 miyaliu666 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

谢谢 @xuxuecho 翻译这篇文章。译文整体很流畅,我提了一些建议,我会直接在发布时修改它们。

我刚给你的邮箱发送了邀请链接,欢迎你注册成为 freeCodeCamp 专栏作者。等你注册之后,我会把译文的作者设置为你的 ID。在注册时请记得设置一个头像哦,最好是本人照片。

除了发布译文,你还可以在专栏发布自己的原创文章。发布文章的流程是:作者写好草稿,把链接发给我,我在 review 之后发布。


## **************📝************** Prerequisites:
- 建议对 3D 软件 Blender 有基本了解。
- 要求具备对 React.js 的基本熟悉。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要基本熟悉 React.js。


`npm install three @react-three/fiber`

For an enriched Three.js experience, we'll also integrate [React Three Drei](https://www.npmjs.com/package/@react-three/drei), a package that introduces an assortment of helpers for diverse Three.js scenarios, including several camera controls, for example:
为了丰富 Three.js 体验,我们还将集成 [React Three Drei](https://www.npmjs.com/package/@react-three/drei), 该包引入了各种适用于不同 Three 的帮助程序.js场景,包括几个摄像头控件,例如:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个包为各种 Three.js 应用场景引入了各种辅助工具,包括多个相机控件


If you're using Visual Studio Code as your Integrated Development Environment (IDE), you can conveniently add the extension through the extensions tab. Again, this extension is optional, but it can significantly simplify certain processes later on. I will use it throughout this tutorial:
如果您使用 Visual Studio Code 作为集成开发环境 (IDE),则可以通过扩展选项卡方便地添加扩展。同样,此扩展是可选的,但它可以显着简化以后的某些流程。我将在整个教程中使用它:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

显著简化


In order to add animations in Blender for your objects, you can switch to the **Animation** tab, next to the **Shading** and **Rendering** tab.
为了在 Blender 中为对象添加动画,您可以切换到 **Shading** 和 **渲染** 选项卡旁边的 **Rendering** 选项卡。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

您可以切换到 ShadingRendering 选项卡旁边的 Animation 选项卡。


In the **Shading** tab, you can add nodes at the bottom of the screen. These nodes can modify the color and texture of an object, among other things. You'll also find `Vector` and `Shader` nodes that, when combined, can create unique visuals for your objects.
**Shading** 选项卡中,可以在屏幕底部添加节点。这些节点可以修改对象的颜色和纹理等。你还会发现 “Vector” 和 “Shader” 节点,将它们组合起来可以为您的对象创建独特的视觉效果。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

原文中有些地方的代码块 在译文中是用引号表示,比如这里的 VectorShader,我在发布时修改。


To summarize, if you find yourself facing a scenario where your materials don't appear as expected in your React.js application with Three.js, considering the baking process and researching this topic can provide valuable insights. This can be particularly beneficial for people who are new to Blender.
总而言之,如果你发现自己面临的情况是材料没有在 Three.js 的 React.js 的应用程序中按照预期显示,那么考虑烘焙过程并研究该主题可以提供有价值的见解。 这对于 Blender 新手来说尤其有益。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果你在使用 Three.js 的 React.js 应用程序中遇到材料无法按预期显示的情况

@miyaliu666 miyaliu666 merged commit 522d49b into freeCodeCamp:main Feb 18, 2024
2 checks passed
@miyaliu666 miyaliu666 added Published 已发布 and removed Review-awaiting 待校对 labels Feb 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Published 已发布
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Auto](如何使用 Three.js 在 React.js 应用程序中实现一个 Blender 模型)
2 participants