Browse Source

Added multires extension parameter and fixed multires zoom bug.

pull/8/head
Matthew Petroff 10 years ago
parent
commit
cb429ffe72
2 changed files with 3 additions and 2 deletions
  1. +1
    -0
      examples/example-multires.json
  2. +2
    -2
      src/js/libpannellum.js

+ 1
- 0
examples/example-multires.json View File

@@ -11,6 +11,7 @@
"multiRes": {
"path": "../examples/multires/",
"extension": "png",
"tileResolution": 256,
"maxSubdivisions": 8
}


+ 2
- 2
src/js/libpannellum.js View File

@@ -479,7 +479,7 @@ function Renderer(canvas, image, imageType) {
for ( var j = 0; j < program.subdivisions; j++ ) {
var index = s*program.subdivisions*program.subdivisions + i*program.subdivisions + j;
program.tileNameArray[program.subdivisions][index] = this.image.path + program.subdivisions + "/" + sides[s] + i + j + ".png";
program.tileNameArray[program.subdivisions][index] = this.image.path + program.subdivisions + "/" + sides[s] + i + j + "." + this.image.extension;
}
}
}
@@ -518,7 +518,7 @@ function Renderer(canvas, image, imageType) {
// Find optimal subdivisions
var newSubdiv = 1;
while ( this.canvas.width > (newSubdiv * this.image.tileResolution) / f && newSubdiv <= this.image.maxSubdivisions ) {
while ( this.canvas.width > (newSubdiv * this.image.tileResolution) / f && newSubdiv < this.image.maxSubdivisions ) {
newSubdiv++;
}


Loading…
Cancel
Save