在伞模型上的ThreeJS UV贴图

时间:2018-09-21 23:59:33

标签: javascript three.js 3d uv-mapping

我有一个无法解决的特定问题。我正在制作一个将图像应用于雨伞的3D模型的软件。伞形模型是根据系统管理员插入的一些参数动态创建的。

到目前为止,我已经成功创建了模型并应用了平面贴图。如果您从顶部看雨伞,那么效果很好,因为它似乎没有变形。

enter image description here

但是,如果您从侧面看模型,则正在发生的图像会明显失真。伞的侧面越垂直,变形就越大,这对于平面贴图是完全可以理解的。

enter image description here

当这家公司专门为制作雨伞纹理而制作出真正的雨伞时,这变得非常明显。

我正在寻找的是一种映射模型的建议,该模型可用于尽可能减少明显的失真(显然,总会有一些失真)。理想情况下,整个伞应该有均匀的变形,垂直伞越多变形就越小,这在平面投影中正在发生。

我不是数学家,因此将非常感谢您使用某种UV映射公式公式,但是我会采纳任何经验丰富的人所提供的建议。

编辑: 这就是我现在如何计算顶点的UV贴图的方法:

<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
    <data>
        <variable name="mytitle" type="java.lang.String"/>
    </data>

<android.support.constraint.ConstraintLayout
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:background="@color/black_background"
    android:layout_height="match_parent">

    <TextView
        android:id="@+id/category_header_textview"
        style="@style/WhiteText"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@{mytitle}"
        app:layout_constraintStart_toStartOf="parent" />

</android.support.constraint.ConstraintLayout>
</layout>

0 个答案:

没有答案
相关问题