KeyShotVR - Default output won't scale in Firefox

Started by ec2638, March 23, 2013, 08:21:01 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ec2638

The default .js and .htlm file KSVR puts out will not scale (resize to window - liquid layout) in Firefox 12.  It will scale in current Safari, Chrome and IE.  Tried fixing it in html with no luck.  You may need to tweak your .js VR outputs.

Any ideas?

Ruckus

Mozilla is up to Firefox 19 (they move through versions incredibly fast).  You might want to try that first.

ec2638

Silly me, I meant Firefox 19.0.2, but typed 12.  Sorry. 

Can get it to scale in all current versions of primary browsers except FF.  There may be a clever hack for that in html, but part of the reason for VR is one does not need to resort to such.  I assume the solution most likely resides in the .js code VR puts out.  For design presentations on the web we like it when the content will scale since we want to fill the viewers screen but we don't know the device and screen size.

Morten Kristensen

#3
What version of KeyShot are you using, ec2638?
And could you supply me with your KeyShotVR output?

ec2638

Thanks for responding, Morten.  I should be more specific.

Version 4.0.74.  You don't really need my output.  Situation is the same for any output.

As I assume you are well aware, the html VR outputs does not scale by default, rather it just repositions (centers) the animation inside the browser window when the window is re-sized (all browsers).  That is good, however, in attempting to modify the default behavior I did change one line in the VR html.

Changed default from:
var windowResizable = true;

Changed to:
var windowResizable = false;

Result - whether loading the animation from the edited default VR htlm or from another page where the edited default VR was displayed via an iframe, the animation would proportionally scale down, or scale up...up to the value set in:

var imageWidth = 800;
var imageHeight = 450;

It would do so in all browsers EXCEPT FIREFOX.  I tried to find a solution in the .js...but frankly such is beyond me.

As mentioned, the impetus was to fill the screen...or the iframe for all potential viewers.  In such a layout one would render out the VR at the maximum expected or desired screen size, with confidence that it will scale to any screen size or the individual's browser window, again basic liquid layouts.

The goal here obviously is to add value, and I'm sure there is a much more elegant and clever way for you guys to code things so your users could select scaling (liquid layout) or static when they setup the render.  I just assumed (correctly or incorrectly) that the fix to my simple hack in FF probably resides in the .js. (could not find any html to add to make FF do what I wanted).  I hope this is something you address in future.

The VR is in the attached .zip, but again it is just a 30 sec output of your default cube model.

Thanks!


Morten Kristensen

Sorry for the slow reply. We had an Easter holiday here.

Thank you for spotting this issue. The problem is that the "max-width" is not always respected in Firefox for some reason. A fix will be made available in the next update of KeyShot.
However, if you want a quick & dirty fix right now then do the following:


  • Open "untitled_VR.37/untitled_VR.37/files/KeyShotVR.js" for editing.
  • Find the following code fragment: q.style["max-width"]="100%"
  • Change it to be: q.style["width"]="100%"

With this fix the VR will scale to fit the window as is expected - just as it did before in other browsers.

Ruckus


ec2638

Very nice!  Thank you for both the quick workaround and the future fix.  Much appreciated, Morten.

Morten Kristensen

You are both very welcome. It's always nice when bugs are spotted by our faithful users.  :)