Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IPython and 3D : draw simple and interactive scenes

I'm working on a little funny project, that draw a planet based on fractal generation. My project works under standard PyOpenGL call, but in order to make it more interactive, I wanted to export it on IPython Notebook.

I only work with some triangles, in cartesian coordinate system. Is there a way, as three.js purpose, to draw a really basic 3D scene based on some polygons in IPython notebooks ? I saw a lot of static plot library but nothing that looks like what I'm looking for.

PS: by interactive, I meen you can rotate the scene for example.

like image 732
FunkySayu Avatar asked Dec 12 '25 02:12

FunkySayu


1 Answers

Sure, take a look at PyThreeJS which is meant as a bridge between Python and ThreeJS. The included example file gives a good overview how to port your code to PyThreeJS in an IPython notebook.

You can make it interactive by combining PyThreeJS with IPython widgets.

like image 82
nluigi Avatar answered Dec 14 '25 16:12

nluigi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!