This PR fixes displaying of textured models by using correct variables during the initialization of the texture request parameters.
Long story what problem this PR fixes
The requestNodeTexture initializes texture requests in the following way:
// nexus.js, around line 1088
function requestNodeTexture(context, node) {
// (...)
var n = node.id;
var m = node.mesh;
if(!m.vertex.texCoord) return;
var tex = m.patches[m.nfirstpatch[n]*3+2];
// (...)
if(m.deepzoom) {
request.url = m.baseurl + tex + '.jpg';
} else {
Object.assign(request, {
url:m.url,
start:m.noffsets[n], // ❗ THE PROBLEM
end:m.noffsets[n+1], // ❗ THE PROBLEM
});
}
// (...)
}
This way of initialization isn't correct, because m.noffsets and n are related to nodes, not textures. It seems that the bug was introduced in the commit 5f96f56.
The PR fixes the bug in the following way:
use m.textures and tex during the initialization of the request instead of m.noffsets and n
Fixes: #125
Description
This PR fixes displaying of textured models by using correct variables during the initialization of the texture request parameters.
Long story what problem this PR fixes
The requestNodeTexture initializes texture requests in the following way:
This way of initialization isn't correct, because
m.noffsets
andn
are related to nodes, not textures. It seems that the bug was introduced in the commit 5f96f56.The PR fixes the bug in the following way:
m.textures
andtex
during the initialization of the request instead ofm.noffsets
andn