1
\$\begingroup\$

I'm currently developing a UV mapping, such as the UVW Map Modifier in 3ds Max (Not Unwrap UVW Modifier).

enter image description here

enter image description here

I split the vertices of the model in the form of a primitive shape (Box, Plane, etc.) and set UV coordinates. However, in the process of duplicating the normal vector, i ran into a problem.

For example, there is a box model with 8 vertices. We need to split the vertices into 24 in order to mapping texture to the 6 sides of the box and set normal vectors separately. In the case of the box, the normal vector calculation is simple. After splitting the vertices, calculate the normal vector for each triangle.

The problem is when this algorithm is applied to the Sphere model. Split the vertices of the sphere model into a Box Shape. (Box Shape is one of the functions of UVW Map modifier). Setting the UV coordinates is fine. The problem is the normal vector setting of the seam vertices.

Simply calculating the normal vector for each triangle, the normal vector of the vertices of the seam is different. (duplicated vertices have the same position). If the normal vector is different, the lighting is not applied properly. Of course, this is solved by calculating the normal vector of the Sphere model before splitting the vertices. However, this method could not be applied to a box model with 8 vertices. The three split vertices of the box must each have a different normal vector.

In summary, split vertices may have different normal vectors or may have the same normal vector. How would you like to solve this? (I used the Box and Sphere model as an example, but in practice it should be applicable to a variety of models.)

\$\endgroup\$
1
  • \$\begingroup\$ Think back to your modelling tools... You can set edges as either soft/smooth or hard/sharp, depending on the terminology. Soft edges mean adjacent tris share an averaged normal. For hard edges, tris use only themselves to calulate normals, giving discontinuous lighting. \$\endgroup\$
    – Basic
    Nov 22, 2020 at 15:07

1 Answer 1

1
\$\begingroup\$

Add an angle parameter. Compute the normal for each triangle, if the angle between adjacent triangles is more than the parameter angle, duplicate the vertex between them. Each copy gets the normal of its triangle, creating a seam.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .