Skip to content

use of global camera #2

@jeromeetienne

Description

@jeromeetienne
mflux: http://learningthreejs.com/blog/2012/03/12/augmented-reality-in-the-browser/
[12:15am] mflux: https://github.com/jeromeetienne/tquery.jsartoolkit
[12:15am] mflux: that one
[12:15am] jetienne: oh yeah this is me
[12:15am] jetienne: let me look
[12:15am] mflux: we can't figure out how its getting the camera obj
[12:16am] mflux: or if there's a duplicate or what
[12:16am] mflux: its saying in line 75 that camera obj is undefined
[12:17am] jetienne: ah yehah i remember
[12:17am] jetienne: jsartoolkit is a js port of a flash lib
[12:17am] jetienne: by ilmari
[12:17am] jetienne: i did some stuff on top
[12:17am] jetienne: oh a bug ?
[12:17am] jetienne: line 75 of which file ?
[12:17am] mflux: yeah i think so? or maybe we're not using it right
[12:17am] mflux: in the main file i think
[12:18am] mflux: https://github.com/jeromeetienne/tquery.jsartoolkit/blob/master/threex.jsartoolkit.js
[12:18am] mflux: line 75
[12:18am] mflux: reference to camera
[12:18am] jetienne: ohhhh
[12:18am] jetienne: i see
[12:19am] jetienne: the error is that i used a global...
[12:19am] jetienne: i did this mistake too in threex.domevents
[12:20am] jetienne: mflux: ok so 1. it is a bug 2. an easy/ugly workaround is to define your camera as a global named 'camera'
[12:20am] • jetienne isn't proud here
[12:20am] jetienne: proper solution would be to add 'this._camera = opts.camera;'  here https://github.com/jeromeetienne/tquery.jsartoolkit/blob/master/threex.jsartoolkit.js#L30
[12:21am] jetienne: and to use this._camera on line 75

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions