Skip to content

Instantly share code, notes, and snippets.

--# Notes
--This project shows how to add different types of lighting to 3D scenes (in this case, a cube)
--The original code was written by spacemonkey. This explanation is by ignatz.
--HOW TO USE THIS PROJECT
--There are a number of tabs at the top. Press on a tab to see its code.
--Work through the tabs from left to right, to see the project develop
--# Main
--Flying demo
--by Andrew_Stacey and ignatz
--February 2014
function setup()
--NOTE - there are lots of settings in this setup function, but you don't have to
--keep all this code. You will find that the draw and RotateAndDraw functions use "if" tests to
@dermotbalson
dermotbalson / gist:8804701
Created February 4, 2014 14:38
Rotation demos v2
--# Notes
--[[
ROTATION WITH QUATERNIONS AND FLYING
This project demonstrates the use of quaternions to rotate objects and fly them
The Main tab only contains code to help you choose from a number of demo projects. You will not need it in
your own projects.
@dermotbalson
dermotbalson / gist:8817757
Last active August 29, 2015 13:56
Rotation demos v2
--# Notes
--[[
ROTATION WITH QUATERNIONS AND FLYING
This project demonstrates the use of quaternions to rotate objects and fly them
The Main tab only contains code to help you choose from a number of demo projects. You will not need it in
your own projects.
@dermotbalson
dermotbalson / gist:8818964
Created February 5, 2014 07:47
3D data X-Wing
This file has been truncated, but you can view the full file.
newmtl x-Wing.mtl
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.320000 0.320000 0.320000
Ks 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
[obj]
@dermotbalson
dermotbalson / gist:8838461
Created February 6, 2014 04:38
Rotation demos v3
--# Notes
--[[
ROTATION WITH QUATERNIONS AND FLYING
This project demonstrates the use of quaternions to rotate objects and fly them
The Main tab only contains code to help you choose from a number of demo projects. You will not need it in
your own projects.
@dermotbalson
dermotbalson / gist:8862308
Last active August 29, 2015 13:56
3D data Me262a
This file has been truncated, but you can view the full file.
# Blender MTL File: 'None'
# Material Count: 30
newmtl Color_003noCulling
Ns 37.254902
Ka 0.000000 0.000000 0.000000
Kd 0.533334 0.533334 0.533334
Ks 0.165000 0.165000 0.165000
Ni 1.000000
d 1.000000
@dermotbalson
dermotbalson / gist:8863467
Last active August 29, 2015 13:56
3D Data F22a
newmtl plane
Ka 0.117647 0.117647 0.117647
Kd 1 1 1
Ks 0.752941 0.752941 0.752941
illum 2
Ns 8
map_Kd FA-22_Raptor_P01.png http://i1303.photobucket.com/albums/ag142/ignatz_mouse/F22/FA-22_Raptor_P01_zps30a76b83.png
//map_bump FA-22_Raptor_N.png http://i1303.photobucket.com/albums/ag142/ignatz_mouse/F22/FA-22_Raptor_N_zps8ef01242.png
//bump FA-22_Raptor_N.png
@dermotbalson
dermotbalson / gist:8876478
Created February 8, 2014 03:57
Rotation demos v4
--# Notes
--[[
ROTATION WITH QUATERNIONS AND FLYING
This project demonstrates the use of quaternions to rotate objects and fly them
The Main tab only contains code to help you choose from a number of demo projects. You will not need it in
your own projects.
@dermotbalson
dermotbalson / gist:9064511
Created February 18, 2014 04:11
3D asteroids
--# Main
--3D asteroids
displayMode(FULLSCREEN)
function setup()
rocks={}
img=readImage("Dropbox:Surface")
timer=0