Created
January 16, 2016 04:58
-
-
Save phase/a8a0f307c43fa780af84 to your computer and use it in GitHub Desktop.
SmileBasic 3D Rendering
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clock = 1 | |
rendx=400/2 | |
rendy=240/2 | |
BKC=RGB(16,16,16) | |
VAR NODE... | |
X=0 | |
Y=0 | |
Z=0 | |
CAMX=0 | |
CAMY=0 | |
CAMZ=0 | |
CAMR=0 | |
CAMP=0 | |
LC=RGB(255,0,0) | |
def ROTATEZ NUM | |
NODE0[0]=NODE0[0]*COS(NUM)-NODE1[0]*SIN(NUM) | |
NODE0[1]=NODE0[1]*COS(NUM)-NODE1[1]*SIN(NUM) | |
NODE0[2]=NODE0[2]*COS(NUM)-NODE1[2]*SIN(NUM) | |
NODE1[0]=NODE1[0]*COS(NUM)-NODE0[0]*SIN(NUM) | |
NODE1[1]=NODE1[1]*COS(NUM)-NODE0[1]*SIN(NUM) | |
NODE1[2]=NODE1[2]*COS(NUM)-NODE0[2]*SIN(NUM) | |
end | |
ROTATEZ 0 | |
while true | |
stick out JOYX,JOYY 'joystick | |
ROTATE JOYX | |
CLS | |
GCLS | |
GFILL 0,0,399,239,BKC | |
GLINE NODE0[0]+rendx... | |
wait clock | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment