[IPython-User] Importing javascript file
Ricardo Amézquita
ramezquitao@gmail....
Sun Sep 16 18:09:09 CDT 2012
I'm trying to develop a 3D viewer in webGL to be used in the ipython
notebook.
Right now I have been able to use standard webGL from the notebook, and now
I'm triying to use the three.js library (http://mrdoob.github.com/three.js/),
but I haven't been able to make it visible for my scripts.
I did the following:
Copy the three.min.js file in the .config/ipython/n/profile_default/static/
When I open the browser in http://127.0.0.1:8888/static/three.min.js I can
see the file.
But when I try to use it in a script:
display(HTML("<script src='/static/three.min.js'></script>"))
js="""
var container, stats;
var camera, scene, renderer;
init();
animate();
......
......
"""
"""
display(Javascript(js))
I get an error message
Error in Javascript !
ReferenceError: THREE is not defined
See your browser Javascript console for more details.
But THREE is defined in the three.min.js file.
I have tried different ways to import the js file without success.
Can some one point me in the wright direction?
Regards
Ricardo
Ricardo Amézquita Orozco
ramezquitao@cihologramas.com
ramezquitao@unal.edu.co
ramezquitao@gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20120916/15a69390/attachment.html
More information about the IPython-User
mailing list