File tree Expand file tree Collapse file tree 3 files changed +14
-0
lines changed
Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -325,11 +325,17 @@ int main()
325325 if (ImGui::CollapsingHeader (" Modify Model" ))
326326 {
327327 ImGui::Indent ();
328+
328329 if (ImGui::Button (" Original" ))
329330 {
330331 obj = objects.findObj (currObject); // search for the object requested
331332 ModifyModel = true ;
332333 }
334+ if (ImGui::Button (" Triangulate Surface" ))
335+ {
336+ obj.MakeTriangleMesh ();
337+ ModifyModel = true ;
338+ }
333339 if (ImGui::Button (" Beehive Surface" ))
334340 {
335341 Surface BH (obj);
Original file line number Diff line number Diff line change @@ -148,3 +148,9 @@ void Object::TriangulateFaces()
148148
149149 m_TriFaceIndices = triFaces;
150150}
151+
152+ void Object::MakeTriangleMesh ()
153+ {
154+ m_FaceIndices = m_TriFaceIndices;
155+ m_NumPolygons = { {3 , static_cast <unsigned int >(m_TriFaceIndices.size ())} };
156+ }
Original file line number Diff line number Diff line change @@ -25,6 +25,8 @@ class Object
2525
2626 void TriangulateFaces ();
2727
28+ void MakeTriangleMesh ();
29+
2830public:
2931 glm::vec3 m_Min;
3032 glm::vec3 m_Max;
You can’t perform that action at this time.
0 commit comments