Skip to content

Instantly share code, notes, and snippets.

Kolosso7

Block or report user

Report or block Kolosso7

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Kolosso7
Kolosso7 / PhongPointLight.txt
Last active Jan 31, 2019
This is Lua code that can be copied and pasted into a new project on the Codea IOS app. It includes a 3D scene lit by a Phong lighting shader. There are also some useful functions that I've written that can be used to easily add vertices, normals & texture coordinates to meshes; such as: addCube, addEllipse & addCylinder.
View PhongPointLight.txt
--# Main
function setup()
-- Set this to true or false to activate/deactivate the lighting shader
useShader = true
rotX,rotY = 0.2,1.3 -- camera rotation
camDist = 100 -- distance from the camera to origin
camOrigin = vec3(0,0,0) -- point of which the camera orbits
lightColour = color(255, 255, 255, 255)
@Kolosso7
Kolosso7 / Corwin
Created Mar 26, 2017
A 3D game for the Codea app
View Corwin
--# Main
-- Dimensions of screen: 1024,768
Worlds = {}
function Worlds.addTri(pos1,pos2,pos3,addTex,col,world)
local col,world = color(255),Worlds.town
local m = world.mesh
do
verts = m.vertices
verts[#verts+1],verts[#verts+2],verts[#verts+3] = pos1,pos2,pos3
View gist:19a23d2236456bb53d9f881a773becdf
--# Main
-- FPS
displayMode(FULLSCREEN)
supportedOrientations(LANDSCAPE_ANY)
-- Use this function to perform your initial setup
function setup()
Player.chunkX = math.ceil(Player.x/1600)
Player.chunkZ = math.ceil(Player.z/1600)
do
You can’t perform that action at this time.