From 6239faff48d9a7174c7b692e72b36d537ca9cbcf Mon Sep 17 00:00:00 2001 From: Syoyo Fujita Date: Thu, 24 Nov 2016 17:41:44 +0900 Subject: [PATCH] Fix draw length for GL_LINES. --- examples/glview/glview.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/examples/glview/glview.cc b/examples/glview/glview.cc index 7c254f4..e13ad38 100644 --- a/examples/glview/glview.cc +++ b/examples/glview/glview.cc @@ -421,7 +421,6 @@ static void SetupCurvesState(tinygltf::Scene &scene, GLuint progId) { size_t vtx_offset = 0; for (int k = 0; k < static_cast(nverts_accessor.count); k++) { for (int n = 0; n < nverts[k] - 1; n++) { - // std::cout << "vn[" << k << "] " << nverts[k] << std::endl; line_pts.push_back(vtx[3 * (vtx_offset + n) + 0]); line_pts.push_back(vtx[3 * (vtx_offset + n) + 1]); @@ -450,7 +449,7 @@ static void SetupCurvesState(tinygltf::Scene &scene, GLuint progId) { line_pts.data(), GL_STATIC_DRAW); glBindBuffer(GL_ARRAY_BUFFER, 0); - state.count = line_pts.size() / 3 / 2; // 2 = GL_LINES + state.count = line_pts.size() / 3; gCurvesMesh[mesh.name] = state; // Material @@ -663,14 +662,14 @@ static void DrawNode(tinygltf::Scene &scene, const tinygltf::Node &node) { } } - std::cout << "node " << node.name << ", Meshes " << node.meshes.size() << std::endl; + //std::cout << "node " << node.name << ", Meshes " << node.meshes.size() << std::endl; for (size_t i = 0; i < node.meshes.size(); i++) { std::map::const_iterator it = scene.meshes.find(node.meshes[i]); if (it != scene.meshes.end()) { - std::cout << it->first << std::endl; + //std::cout << it->first << std::endl; // FIXME(syoyo): Refactor. DrawCurves(scene, it->second); DrawMesh(scene, it->second); @@ -710,7 +709,7 @@ static void DrawScene(tinygltf::Scene &scene) { if (node_it == scene.nodes.end()) continue; - std::cout << "root: " << node_it->first << std::endl; + //std::cout << "root: " << node_it->first << std::endl; DrawNode(scene, node_it->second); }