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
--# Notes | |
--[[ | |
This set of demos is aimed at people who have not worked with 3D before. | |
3D is a very, very big subject, with a lot to learn, so this set of demos can only scratch the surface, and cannot possibly explain everything there is to know. | |
You can simply watch the demos to see what Codea can do, but ideally,you should read up on 3D before trying to understand how the demos work, and before trying your own projects. | |
Also, this is not a set of "Wow, look what 3D can do" demos. If you look at them all without reading the notes, |
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
--# Notes | |
--[[ | |
This project shows how to add different types of lighting to 3D scenes (in this case, a cube) | |
--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 |
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
--# Notes | |
--[[ | |
** What is a mesh? ** | |
A mesh is a quick way of drawing a shape. It is a set of points which create an outline (or wirefame) of an object | |
It is made up of triangles (groups of three points) | |
Triangles are used because a triangle has the smallest number of points that encloses an area | |
Each triangle corner is known as a VERTEX, and has a position and a colour | |
The colours of all the points inside the triangle are interpolated from the colours of the three corners |
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
q |
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
--# Main | |
displayMode(FULLSCREEN) | |
function setup() | |
size,radius=150,15 | |
CreateScene() | |
end | |
function CreateScene() --size is size of 3D box |
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
--# Main | |
--# Main | |
displayMode(FULLSCREEN) | |
function setup() | |
size,radius=150,15 | |
CreateScene() |
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
--# Main | |
--# Main | |
displayMode(FULLSCREEN) | |
function setup() | |
size,radius=200,10 | |
CreateScene() |
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
--# Main | |
displayMode(FULLSCREEN) | |
function setup() | |
size,radius=200,10 | |
pos=vec3(0,0,0) --assumes centre of box is (0,0,0) | |
CreateScene() | |
notStarted=true | |
end |
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
--# Main | |
displayMode(FULLSCREEN) | |
function setup() | |
size,radius=200,10 | |
startPos=vec3(size/2,size/2,-size/2) --assumes centre of box is (0,0,0) | |
CreateScene(size,radius,startPos) | |
notStarted=true | |
end |
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
--# Main | |
displayMode(FULLSCREEN) | |
function setup() | |
size,radius=200,10 | |
startPos=vec3(size/2,size/2,-size/2) --assumes centre of box is (0,0,0) | |
CreateScene(size,radius,startPos) | |
notStarted=true | |
end |
NewerOlder