I'm trying to develop a 3D viewer in webGL to be used in the ipython notebook.<br><br>Right now I have been able to use standard webGL from the notebook, and now I'm triying to use the three.js library (<a href="http://mrdoob.github.com/three.js/">http://mrdoob.github.com/three.js/</a>), but I haven't been able to make it visible for my scripts.<br>
<br>I did the following:<br><br>Copy the three.min.js file in the .config/ipython/n/profile_default/static/<br><br>When I open the browser in <a href="http://127.0.0.1:8888/static/three.min.js">http://127.0.0.1:8888/static/three.min.js</a> I can see the file.<br>
<br>But when I try to use it in a script: <br><br>display(HTML("<script src='/static/three.min.js'></script>"))<br><br>js="""<br> var container, stats;<br> var camera, scene, renderer;<br>
<br> init();<br> animate();<br>......<br>......<br>"""<br>"""<br>display(Javascript(js))<br><br>I get an error message<br><br><div style="display:block" class="hbox output_area">
<div class="box-flex1 output_subarea"><div class="js-error">Error in Javascript !<br>ReferenceError: THREE is not defined<br>See your browser Javascript console for more details.<br><br>But THREE is defined in the three.min.js file.<br>
<br>I have tried different ways to import the js file without success. <br><br>Can some one point me in the wright direction?<br><br>Regards<br><br>Ricardo<br><br></div></div></div><br> <br><br clear="all">Ricardo Amézquita Orozco<br>
<br><a href="mailto:ramezquitao@cihologramas.com">ramezquitao@cihologramas.com</a><br><a href="mailto:ramezquitao@unal.edu.co">ramezquitao@unal.edu.co</a><br><a href="mailto:ramezquitao@gmail.com">ramezquitao@gmail.com</a><br>