OZONE Asylum
Forums
Server-Side Scripting - Oh my!
Creating Sudoku 3x3x3x3
This page's ID:
33324
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
Cobbled this together last night. Then I spend the morning trying to update matplotlib for ortho rendering. Lots of hard coding with notes left in. I even left some bonus code commented out in the main data loop. Wanna see a plane? No prob. Wanna see just the 0's? No prob. This is my first time actually touching code for this. When it comes to things like this, I work so much faster and better with graph paper and pencil. I used 3 sheets so far! OMG! Maybe later I'll bust out my dry erases board (I found my markers finally). Some of my notes actually consist of photographs of my dry erase board. No tech like low tech. [code] #!/usr/bin/env python # -*- coding: utf-8 -*- from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt fig = plt.figure() ax = fig.gca(projection='3d') ax.set_proj_type('ortho') #372 480 561 #804 615 723 #156 237 048 #615 723 804 #237 048 156 #480 561 372 #048 156 237 #561 372 480 #723 804 615 c0=[[[3,7,2],[8,0,4],[1,5,6]],[[4,8,0],[6,1,5],[2,3,7]],[[5,6,1],[7,2,3],[0,4,8]]] c1=[[[6,1,5],[2,3,7],[4,8,0]],[[7,2,3],[0,4,8],[5,6,1]],[[8,0,4],[1,5,6],[3,7,2]]] c2=[[[0,4,8],[5,6,1],[7,2,3]],[[1,5,6],[3,7,2],[8,0,4]],[[2,3,7],[4,8,0],[6,1,5]]] #012 120 201 #201 012 120 #120 201 012 tcube=[[[0,1,2],[2,0,1],[1,2,0]],[[1,2,0],[0,1,2],[2,0,1]],[[2,0,1],[1,2,0],[0,1,2]]] mcube=[[[c0,c1,c2],[c2,c0,c1],[c1,c2,c0]],[[c1,c2,c0],[c0,c1,c2],[c2,c0,c1]],[[c2,c0,c1],[c1,c2,c0],[c0,c1,c2]]] #ax.text(0,0,0, '0') nscale=3 buff=1 for bz in range(3): for by in range(3): for bx in range(3): for cz in range(3): for cy in range(3): for cx in range(3): #nv=mcube[bz][by][bx][cz][cy][cx] #if nv==0: #nz=(bz*3+cz+buff*bz)*nscale #ny=(by*3+cy+buff*by)*nscale #nx=(bx*3+cx+buff*bx)*nscale #ax.text(nx,ny,nz, nv) if by==0 and cy==0: nv=mcube[bz][by][bx][cz][cy][cx] nz=(bz*3+cz+buff*bz)*nscale ny=(by*3+cy+buff*by)*nscale nx=(bx*3+cx+buff*bx)*nscale ax.text(nx,ny,nz, nv) vmax=(2*3+2+buff*2)*nscale+1 ax.set_xlim(-1, vmax) ax.set_ylim(-1, vmax) ax.set_zlim(-1, vmax) ax.set_xlabel('X axis') ax.set_ylabel('Y axis') ax.set_zlabel('Z axis') plt.show() [/code]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »
Maximum Security
OZONE
DHTML/Javascript
Server-Side Scripting - Oh my!
CSS - DOM - XHTML - XML - XSL - XSLT
Stupid Basic HTML
Visual Therapy
Photoshop
Photoshop Pong, Anyone?
***WARNING*** BIG SIG APPROACHING
Photography
3D Modelling & Rendering
Multimedia/Animation
Print Graphics
Holding Pens
Philosophy and other Silliness
Outpatient Counseling
Site reviews!
Mad Scientists' Laboratory
Getting to know the Grail