{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "from k3d import K3D\n", "import random\n", "\n", "plot = K3D()\n", "view_matrix = (\n", " (0.0, 1.0, 0.0, -25.0),\n", " (0.0, 0.0, 1.0, -25.0),\n", " (1.0, 0.0, 0.0, -25.0),\n", " (0.0, 0.0, 0.0, 1.0)\n", ")\n", "points_number = 400\n", "positions = tuple(tuple(random.uniform(1, 50) for i in range(3)) for i in range(points_number))\n", "colors = tuple(tuple(random.uniform(0, 1) for i in range(3)) for i in range(points_number))\n", "plot += K3D.points(view_matrix, positions, colors, point_size=3.0)\n", "plot.display()" ] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "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.6" } }, "nbformat": 4, "nbformat_minor": 0 }