Working in vertices

Hi!
I’d like to find out how to work in level of vertices. Is it possible to detect collisions aswell as find out several other parameters in level of vertices? Also, is it possible to move them? And if so, how to recalculate normals correctly in that case?
Lastly - is it possible to find out which vertices are joined by faces?

All of this information would help me a lot to make several tasks way easier.
Thanks!:slight_smile:

Yes you can, to get the vertices you have to get mesh first

mesh = obj.meshes[0] #This will will get you the first mesh

to get the vertex,

vertex = mesh.getVertex(0, 0) #This will get you the first vertex on the first material on the mesh

Now you can do all kinds of stuff you can learn more about it HERE

To find the vertices attached to a face you have to first get that polygon with a similar method,

poly = mesh.getPolygon(0) #This will get you the first polygon on that mesh.

To get the vertices,

vertex = poly.v1 #v1 will get you first vertex, v2 second, v3 third and so on. 

THIS should help you.

OK! Great. Now - is it possible to find out which other vertices are connected to the current vertex? I need to find out if there’s an edge between them(I know that edges aren’t real, but there must be an index buffer where the connections are stored).

So! This is critically important question:
How do I find out which other vertices are connected to the current vertex? Is there any way to do this?

And a little less important question:
Can I assign values to vertices(without using vertex colors)? If not, I could store them in a dictionary with the vertex indices anyways.

With difficulty. If things are shaded smooth, then connected vertices are connected. If it’s shade flat then they aren’t, and you’ll have to figure out a way to generate/store this data yourself.

Assign values to them? What are you trying to do? I can’t think of a good way of doing this.