I have a small obj loader and it takes two parameters and passes them back to the input variables.. however this is my first time doing this and i\'m not sure how to print s
glm::vec3
doesn't overload operator<<
so you can't print the vector itself. What you can do, though, is print the members of the vector:
std::cout << "{"
<< vertices[i].x << " " << vertices[i].y << " " << vertices[i].z
<< "}";
Even better, if you use that a lot, you can overload operator<<
yourself:
std::ostream &operator<< (std::ostream &out, const glm::vec3 &vec) {
out << "{"
<< vec.x << " " << vec.y << " "<< vec.z
<< "}";
return out;
}
Then to print, just use:
std::cout << vertices[i];