patrickfuller / imolecule

An embeddable webGL molecule viewer and file format converter.
http://patrickfuller.github.io/imolecule/
MIT License
86 stars 18 forks source link

vertexShader and fragmentShader parameters are undefined #3

Closed bjonnh closed 9 years ago

bjonnh commented 9 years ago

Hi,

I cannot see the molecule (latest IPython git, self-compiled openbabel, Python 3).

I get two errors in console about vertexShader and fragmentShader being not defined from THREE.Material.

patrickfuller commented 9 years ago

Hi,

I have the same exact setup, and it works for me. Proof:

screen shot 2015-03-23 at 10 18 26 am

The vertexShader and fragmentShader are important parts of three.js, which imolecule is built on top of. This error doesn't indicate the underlying issue, so we'll have to guess and check.

I'd start by installing imolecule without openbabel / rdkit:

pip install imolecule

Then, test my example code in a notebook:

import imolecule
imolecule.draw("c1ccccc1")

If that doesn't work, try manually updating the minified js file:

cd ~/.ipython/nbextensions
ls # should see imolecule.min.js
wget https://raw.githubusercontent.com/patrickfuller/imolecule/master/js/build/imolecule.min.js

Then, restart the notebook kernel, and re-run the imolecule code. Let me know how this goes!

bjonnh commented 9 years ago

I got it working by:

I wonder what was wrong, but I was playing with a lot of libraries at the same time so maybe threejs was already loaded from somewhere else…