Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error upon loading Uncaught TypeError: Cannot read property 'width' of null #150

Open
GoogleCodeExporter opened this issue Apr 9, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

<script type= "text/javascript" src="js/Detector.js"></script>
  <script type= "text/javascript"src="js/jsc3d.js"></script>
  <script type= "text/javascript"src="js/jsc3d.touch.js"></script>
 <script type= "text/javascript" src="js/jsc3d.webgl.js"></script>

<script type="text/javascript" id="virg">

var canvas= document.getElementById('virgin');
var viewer= new JSC3D.Viewer (canvas);

     viewer.setParameter('SceneUrl', 'virg.obj');
     viewer.setParameter('InitRotationX', 0);
     viewer.setParameter('InitRotationY', 0);
     viewer.setParameter('InitRotationZ', 0);
     viewer.setParameter('BackgroundColor', '#FFFFF');
     viewer.setParameter('RenderMode', 'texturesmooth');
     viewer.setParameter('SphereMapUrl', 'images/black.png');
     viewer.setParameter( 'Renderer', 'webgl');
     viewer.init();
     viewer.update();

        var ctx = canvas.getContext('2d');


    function changeDefinition(definition) {

                    if(definition == 'high' && viewer.isWebGLEnabled() && JSC3D.PlatformInfo.browser == 'chrome')
                    definition = 'standard';

                viewer.setDefinition(definition);
                viewer.update();
            }
</script>
What is the expected output? What do you see instead?
 I expect to have my obj loaded. in my console it says 
Uncaught TypeError: Cannot read property 'width' of null 
jsc3d.js:95

and anonymous function in my index referring to the .viewer

What version of the product are you using? On what operating system?

jscd 1.6.5


Original issue reported on code.google.com by ootsil.k...@gmail.com on 27 Feb 2015 at 11:01

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant