I have an entity in 3D, which is defined by a std::vector of points. Each point is an std::vector containing three values :, X, Y and Z.
So it's really a vector< vector< int > >.
I want to find the geometrical center of the 3D entity. To do this, I think I have to find the minimum X and maximum X, and take the value in-between, repeat for Y, repeat for Z; those three values are the center.
I could of course proceed with a bunch of for loops but this is tedious. To find maximum and minimum values, I could more easily use the sort algorithm of the STL. I'm a bit clueless at how I would implement this, though. Yes generally speaking I know how to implement a functor for an algorithm but in this case my brain refuses to cooperate.
Apple should release a rumour that they are going to make their next flagship a circle so that Samsung can copy it quickly and release it "before Apple do as we are visionaries!!!11"
I don't think you read the article entirely. Disabling secure boot is temporary. Once the install is complete it seems to be fine?
It's not a solution, it's a workaround that maintains the security options after the installation is complete.
Question
Andre S. Veteran
Hello,
I have an entity in 3D, which is defined by a std::vector of points. Each point is an std::vector containing three values :, X, Y and Z.
So it's really a vector< vector< int > >.
I want to find the geometrical center of the 3D entity. To do this, I think I have to find the minimum X and maximum X, and take the value in-between, repeat for Y, repeat for Z; those three values are the center.
I could of course proceed with a bunch of for loops but this is tedious. To find maximum and minimum values, I could more easily use the sort algorithm of the STL. I'm a bit clueless at how I would implement this, though. Yes generally speaking I know how to implement a functor for an algorithm but in this case my brain refuses to cooperate.
Any help is appreciated.
Link to comment
https://www.neowin.net/forum/topic/700528-c-sorting-a-vector-of-vectors/Share on other sites
4 answers to this question
Recommended Posts