- Home /
Finding lowest point of a mesh
Hello, I am in the process of creating a mini golf game. One part of the game is that I want a feature like "read the green, that will determine the lowest vertical point and the highest vertical point of a mesh, and then shade them so that the user can understand the slope of the course more adequately. I am assuming that the best way to go about doing this would be to cycle through the vertices of the mesh that I place onto the golf course's model, but I could be wrong. What would be the appropriate or efficient way to go about doing this? Thank you very much in advance, I am still a bit new at Unity and am so glad there's a community for it to help out :)
I would also be okay with adding a grid-like texture over the course to help the user aim, as seen in this video. I'm not sure if I would still need to deter$$anonymous$$e the highest and lowest point of the green then. http://www.youtube.com/watch?v=cHGab1oz-AY
So yep - I'd cycle through all of the vertices and maybe then do it again and add vertex colours to use in a shader. Or you could just have a shader work based on world space Y to create the colors.