{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "application/javascript": [ "require.undef(\"nbextensions/vpython_libraries/glow.min\");" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "require.undef(\"nbextensions/vpython_libraries/glowcomm\");" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "require.undef(\"nbextensions/vpython_libraries/jquery-ui.custom.min\");" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "require([\"nbextensions/vpython_libraries/glow.min\"], function(){console.log(\"GLOW LOADED\");})" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "require([\"nbextensions/vpython_libraries/glowcomm\"], function(){console.log(\"GLOWCOMM LOADED\");})" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "require([\"nbextensions/vpython_libraries/jquery-ui.custom.min\"], function(){console.log(\"JQUERY LOADED\");})" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "window.__context = { glowscript_container: $(\"#glowscript\").removeAttr(\"id\")}" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "from vpython import *\n", "scene.width = 600\n", "scene.height = 600\n", "scene.background = color.gray(0.9)\n", "scene.range = 1.3\n", "s = 'Pixel-level transparency using \"depth-peeling.\"\\n'\n", "s += \"Note the correct transparencies of the intersecting slabs.\\n\"\n", "scene.title = s\n", "\n", "box(pos=vec(0,0,0), opacity=1, size=vec(1,1,1), texture=textures.flower)\n", "sphere(pos=vector(0,0,.9), opacity=0.3, shininess=0, radius=0.2, color=color.green)\n", "s = sphere(pos=vector(0.1,0,1.2), opacity=0.2, shininess=0, radius=0.1, color=color.cyan)\n", "box(pos=s.pos, size=0.06*vector(1,1,1), color=color.gray(.2))\n", "box(pos=vector(0,.5,1), color=color.red, opacity=0.2, size=vector(.05,.2,.8), axis=vector(1,0,1) )\n", "box(pos=vector(0,.5,1), color=color.cyan, opacity=0.2, size=vector(.05,.2,.8), axis=vector(1,0,-1))\n", "\n", "scene.caption = \"\"\"Right button drag or Ctrl-drag to rotate \"camera\" to view scene.\n", "To zoom, drag with middle button or Alt/Option depressed, or use scroll wheel.\n", " On a two-button mouse, middle is left + right.\n", "Touch screen: pinch/extend to zoom, swipe or two-finger rotate.\"\"\"" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "anaconda-cloud": {}, "kernelspec": { "display_name": "VPython", "language": "python", "name": "vpython" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.12" } }, "nbformat": 4, "nbformat_minor": 1 }