I try to use construct_mesh to build the mesh.
When I make a horizontal mesh, vertex normal is correct.
for the top cap, I use a counterclockwise order [0,1,2, 0,2,3, 0,3,4], and for the bottom cap, I use a clockwise order [5,9,8, 5,8,7, 5,7,6]. it works fine.
but when I connect the two caps, the vertex normal became wrong.
I use counterclockwise order for all vertical surfaces, something like:
[0,5,6,1, 1,6,7,2, ...]
So what's wrong?
Solved! Go to Solution.
Solved by mjcg91. Go to Solution.
This looks fine to me. The default visualization of a mesh without normal should look like this. Even if you update the mesh normals it will still appear close to this.
If you want sharp edges, Compute your face_vertex_normal using the face_normal.
These are not node but name of properties.
You can update the face_normal using update_mesh_normals. There is no built-in nodes to compute face_vertex_normal though, you'll have to compute it yourself. you can find an example inside create_mesh_cube.
I only found a set_point_normal node.
If my understanding of point and face_vertex is correct, how does one point define the direction of two face_vertex?
face vertex normals are not relying on anything. In fact you can set any vector you want, but usually it is using face normals, especially if you want to make all edges sharp edges. For a quad, you should use the same face normals vector for all the face vertices of this face.
If you don't want to bother with this, you should use soften_harden_mesh_normals from MJCG compounds. It can be used for advanced normal generation.
I found a new problem.
After using soften_harden_mesh_normals, it is indeed effective for Bifrost mesh. but the output to Maya is still all "soft edges".
You have to enable Transfer Normals on bifrostGeoToMaya.
Currently, the only way is to use Mesh Display -> Soften/Harden Edges in Maya
And must remove "soften_harden_mesh_normals", otherwise it will be invalid.
Ah, this is a limitation in my compound. I guess bifrostGeoToMaya needs the face_vertex_normal_index property to work correctly. My compound only generates the normals. i'll fix this for future release.
For now you could edit the compound and set the property using the node found inside create_mesh_cube. The indices array should be set using get_array_indices from the mesh's face_vertex. After this is should work fine.
Now I understand why the faces of "create_mesh_star" are separated. without merging vertices. because that messes up normals, and it is difficult to correct them.
create_mesh_star By 4z5lph0c
https://area.autodesk.com/downloads/modelingprimitivecreate-mesh-star/
I think the author just didn't bother to construct the mesh with connectivity. It is simpler like this.
Dealing with point normals is easy, you just have to use update_mesh_normals, but when you need face_vertex_normals, it's a little bit more complicated, but still doable.
I don't understand you said "property" things at all. I haven't touched those yet. I think they will be my "level 3" course. for now, I'm a little satisfy my work.
Can't find what you're looking for? Ask the community or share your knowledge.