Skip to content

camera is not an instance of THREE.Camera #3209

@ghost

Description

I am having a problem with the PerspectiveCamera.

Using the default scene in blender I exported it out using the three.js exporter. I included the camera amongst all the other objects and materials etc.

I have been building a JSON file - using it as a namespace (called gl) to set up future projects. It has a render function, a init function and update function. The init functions checks for browser compatibility and ensures that all the "libraries" (for lack of a better term) exist. Then it sets up webgl renderer and loads the JSON scene. It's similar to the load geometries example, except without all the different loaders. The camera variable is assigned to the currentCamera in the scene.

gl.camera = scene.currentCamera;

According to google chome. The problem is in the render function.

"render" : function () {
    "use strict";
    gl.renderer.render(gl.scene.scene, gl.camera);
}

Google prints the message THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera. Using the watch expression the camera: THREE.PerspectiveCamera.

Why is the happening? doesn't PerspectiveCamera inherit THREE.Camera?

Also I can access the .updateProjectionMatrix() for some reason.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions