类似于这种字体,可以用Text或者Text3d,但是要处理一个问题,就是要保证字体一直正面视角。
这中间的处理比较的麻烦,于是可以使用react-three-drei中的Html来做这件事文章来源地址https://www.toymoban.com/news/detail-820825.html
<Html position={position} center distanceFactor={12} >
<div
style={{
position: "relative",
display: "flex",
flexDirection: "column",
...extraStyle,
textAlign:placement
}}
>
<div
class="circle"
style={{ position: "absolute", [placement]: 0 }}
></div>
<b
style={{
color: "white",
fontSize: "16px",
fontWeight: "bold",
}}
>
{warnTitle}
</b>
<span
style={{
color: "white",
fontSize: "12px",
display: "block",
wordBreak: "keep-all",
}}
>
{warnText}
</span>
</div>
</Html>
文章来源:https://www.toymoban.com/news/detail-820825.html
到了这里,关于Three.js 的组件库react-three-fiber和react-three-drei的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!