-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vertex / Face colors #96
Comments
what does spheregeometry.faces.length do? |
Gives you the number of faces in the sphere geometry I'm assuming. It's just a list. |
thank you - by the way, how does it different from spheregeometry.vertices.length? |
So it steps through each face and determines whether it's a tri or a quad face and then steps through each vertex of the face and assigns a color to it. I think you should also be able to set a color to all the vertices in the face, which is the commented out line. However, this doesn't work either. |
spheregeometry.vertices.length is the total number of vertices that make up all the faces. Each face has 3 (tri) or 4 (quad) vertices. |
very nice, thank you indeed. one more question, do you know how I can select the neighboring faces of the selected face? |
i.e. if I select the face[38] I also want to get neighboring face such as face[36] face[37] |
I'm not sure if there is an easy way to do this. You may have to go through each face and test for adjacency of all the other faces which will be quite an expensive operation if you have a lot of faces. Did you manage to get vertex/face colors working then as per the original issue? |
not yet though. I just found out the indices of the neighboring faces have a pattern. For an example, if the index of the selected mesh is odd number X, the indices of the neighboring faces would go like X-1, X+1, X+1+20. In other case, if the index of the selected mesh is even number Y, the indices of the neighboring faces would go like Y-1, Y+1, Y-1+20. I think I will start from writing a new function from here which would be called recursively. |
OK - sounds good. Let me know if you manage to get the vertex colors working as I haven't had any success. |
sure, I will do :) |
Just wondered if anyone had got vertex or face colors to work? Variations of the following code always seem to give me a white sphere:
Anything obvious I'm doing wrong?
The text was updated successfully, but these errors were encountered: