Jump to content

OrthoTop is undefined


Lange
 Share

Recommended Posts

Hey I have just started on using babylon. I started using it together with your Unity exporter. I made the camera go from perspective to orthographics and I got a runtime error : 

Uncaught TypeError: Cannot set property 'orthoTop' of undefined

In this line

this._camera.orthoTop = n,

as part of 

 

      n.prototype.updateOrthographicSize = function() {
            if (0 !== this._orthoSize) {
                var e = this.scene.getEngine().getRenderingCanvasClientRect()
                  , t = e.width / e.height
                  , n = this._orthoSize
                  , i = n * t;
                this._camera.orthoTop = n,
                this._camera.orthoBottom = -n,
                this._camera.orthoLeft = -i,
                this._camera.orthoRight = i
            }
        }
        ,

 

manager.js

Link to comment
Share on other sites

I'm not sure about how I upload textures or .bablyon scene for playground except for sandbox, but on that site I can't seem to find the save button. 

I have narrowed the error down to only when i resize the window (for example when i open the chrome console that split the window it creates the error). 

Link to comment
Share on other sites

Hi,

this is a javascript error not an error specific to babylon. Your _camera property is undefined thus its orthoTop property can't be set (as undefined is not an object).

Without a bigger chunk of your code I don't think we can help you here. My tip is to search for each line of your code where you set the _camera property and see if there is a line that doesn't do what you intended it to.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...