This file contains hidden or 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 | |
--3D Model viewer | |
State={Ready=1,Loading=2,Error=3} | |
function setup() | |
parameter.integer("Choose",1,#Models,3) | |
parameter.action("Load",ShowModel) | |
parameter.integer("Zoom",1,300,50) | |
parameter.boolean("AutoRotate",true) |
This file contains hidden or 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 | |
-- Sandbox | |
supportedOrientations(LANDSCAPE_ANY) | |
displayMode(FULLSCREEN_NO_BUTTONS) | |
--displayMode(OVERLAY) | |
--displayMode(FULLSCREEN) | |
function setup() | |
screen=vec2(WIDTH,HEIGHT) |
This file contains hidden or 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 | |
-- Component System by Utsira. uses runtime mix-ins to add component's methods to entities (ie not a pure entity - component - system model). | |
-- TO USE: | |
-- Entity is a superclass that adds the method :add, for adding (including) components to game objects(entities). | |
-- Components are tables, but use : to name their methods. | |
-- If component has an iterator table then it is a system. Iterate will run through every entity that is part of that system | |
-- If component has an :init function, this will not be added to the entity, but will instead be run when the component is added | |
-- Use this function to perform your initial setup | |
function setup() |
This file contains hidden or 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 | |
-- Disintegration Shader | |
supportedOrientations(LANDSCAPE_ANY) | |
function setup() | |
-- parameter.watch("grav") | |
-- parameter.watch("gravBack") --for bug-checking the get local point function | |
print ("tilt to spin the sphere \ntap the screen to explode / unexplode the mesh") | |
aerial = color(28, 27, 54, 255) | |
verts = Isosphere(5) |
This file contains hidden or 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 | |
-- Json Test | |
supportedOrientations(LANDSCAPE_LEFT) | |
displayMode(OVERLAY) | |
-- Use this function to perform your initial setup | |
function setup() | |
parameter.action("Take snapshot", function() tabSave(objects, "Test") end) | |
parameter.action("Load from snapshot", function() killBodies() loadBodies() end) | |
AddToJson() --establish metamethods for encoding vec2, vec3, vec4, matrix as json objects |
This file contains hidden or 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 | |
-- Markdown Codea | |
-- by Yojimbo2000 | |
displayMode(FULLSCREEN) | |
function setup() | |
setText() | |
y,vel = 0,0 | |
scrollY={} --store deltas for smooth scrolling upon finger release | |
end |
This file contains hidden or 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 | |
-- Markdown Codea | |
-- paragraph-stitching version | |
-- by Yojimbo2000 | |
displayMode(OVERLAY) | |
displayMode(FULLSCREEN) | |
function setup() | |
state = Stitch | |
state.init() |
This file contains hidden or 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
function setup() | |
local connectionMade = function() | |
output.clear() | |
parameter.clear() | |
print("Connected!") | |
gameSetup() | |
end | |
multihandler = Multiplayer(receiveData, connectionMade) |
This file contains hidden or 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 | |
--Simple Blender .obj loader | |
--assumes each object has only one texture image | |
--currently only supports one object per file | |
--todo: remote images | |
local touches, tArray, lastPinchDist = {}, {} |
This file contains hidden or 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
func renderer(_ renderer: SCNSceneRenderer, didUpdate node: SCNNode, for anchor: ARAnchor) { | |
guard let plane = anchor as? ARPlaneAnchor, | |
let geometry = node.geometry as? ARSCNPlaneGeometry | |
else { return } | |
geometry.update(from: plane.geometry) | |
node.boundingBox = planeBoundary(extent: plane.extent) | |
} |
OlderNewer