From c05560cee1053c3b999a230390583f668f6b1186 Mon Sep 17 00:00:00 2001 From: Federico Ponchio Date: Wed, 23 Jan 2019 18:35:14 +0100 Subject: [PATCH] removed texture debug, fixe pointsize in js. --- html/js/nexus.js | 15 +++++++-------- src/nxsbuild/nexusbuilder.cpp | 8 ++++---- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/html/js/nexus.js b/html/js/nexus.js index 6fa3a1f..9c5c7b0 100644 --- a/html/js/nexus.js +++ b/html/js/nexus.js @@ -820,10 +820,9 @@ Instance.prototype = { if(t.mode == "POINT") { var pointsize = t.pointsize; - if(!pointsize) { - var pointsize = Math.ceil(0.30*t.currentError); - if(pointsize > 2) pointsize = 2; - } + if(!pointsize) + var pointsize = Math.ceil(1.2* Math.min(error, 5)); + if(typeof attr.size == 'object') { //threejs pointcloud rendering gl.uniform1f(attr.size, 1.0); gl.uniform1f(attr.scale, 1.0); @@ -831,10 +830,10 @@ Instance.prototype = { gl.vertexAttrib1fv(attr.size, [pointsize]); var error = t.nodeError(n); -// var fraction = (error/t.currentError - 1); -// if(fraction > 1) fraction = 1; -// var count = parseInt(fraction * nv); - count = nv; + var fraction = (error/t.currentError - 1); + if(fraction > 1) fraction = 1; + + var count = nv; if(count != 0) { if(m.vertex.texCoord) { var texid = m.patches[m.nfirstpatch[n]*3+2]; diff --git a/src/nxsbuild/nexusbuilder.cpp b/src/nxsbuild/nexusbuilder.cpp index b220e4e..b1be352 100644 --- a/src/nxsbuild/nexusbuilder.cpp +++ b/src/nxsbuild/nexusbuilder.cpp @@ -474,7 +474,7 @@ QImage NexusBuilder::extractNodeTex(TMesh &mesh, int level, float &error, float } - painter.setPen(QColor(255,0,255)); + /* painter.setPen(QColor(255,0,255)); for(int i = 0; i < mesh.face.size(); i++) { auto &face = mesh.face[i]; int b = vertex_to_box[face.V(0) - &(mesh.vert[0])]; @@ -491,7 +491,7 @@ QImage NexusBuilder::extractNodeTex(TMesh &mesh, int level, float &error, float float y1 = V1->T().P()[1]/pdy; //how many pixels from the origin painter.drawLine(x0, y0, x1, y1); } - } + }*/ /* for(int i = 0; i < mesh.vert.size(); i++) { auto &p = mesh.vert[i]; @@ -510,8 +510,8 @@ QImage NexusBuilder::extractNodeTex(TMesh &mesh, int level, float &error, float } image = image.mirrored(); - static int imgcount = 0; - image.save(QString("OUT_test_%1.jpg").arg(imgcount++)); + //static int imgcount = 0; + //image.save(QString("OUT_test_%1.jpg").arg(imgcount++)); return image; }