Skip to content

Commit

Permalink
removed texture debug, fixe pointsize in js.
Browse files Browse the repository at this point in the history
  • Loading branch information
ponchio committed Jan 23, 2019
1 parent 87a1b85 commit c05560c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
15 changes: 7 additions & 8 deletions html/js/nexus.js
Original file line number Diff line number Diff line change
Expand Up @@ -820,21 +820,20 @@ 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);
} else
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];
Expand Down
8 changes: 4 additions & 4 deletions src/nxsbuild/nexusbuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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])];
Expand All @@ -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];
Expand All @@ -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;
}

Expand Down

0 comments on commit c05560c

Please sign in to comment.