Created by Christopher Manning
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
/* | |
WorkCrew - a WebWorker work queue library | |
Usage: | |
// Create an 8 worker pool using worker.js. | |
var crew = new WorkCrew('worker.js', 8); | |
// Do something whenever a job is completed. | |
// The result object structure is |
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
// | |
// GPUImageTextureInput+CIImage.h | |
// GPUImage | |
// | |
// Created by Sam Soffes on 3/4/14. | |
// Copyright (c) 2014 Sam Soffes. All rights reserved. | |
// | |
#import "GPUImageTextureInput.h" |
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
#import <UIKit/UIKit.h> | |
#import <SceneKit/SceneKit.h> | |
#import <OpenGLES/ES2/gl.h> | |
#import <OpenGLES/ES2/glext.h> | |
@interface View : UIView | |
@property (strong, nonatomic) SCNScene *scene; | |
- (void)renderFrame; |
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
// Configure the Scene View | |
self.sceneView.backgroundColor = [UIColor darkGrayColor]; | |
// Create the scene | |
SCNScene *scene = [SCNScene scene]; | |
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
// | |
// SimpleScrollingStack.swift | |
// A super-simple demo of a scrolling UIStackView in iOS 9 | |
// | |
// Created by Paul Hudson on 10/06/2015. | |
// Learn Swift at www.hackingwithswift.com | |
// @twostraws | |
// | |
import UIKit |
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
#import <UIKit/UIKit.h> | |
#import <objc/runtime.h> | |
// Hook with ObjC runtime functions | |
%config(generator=internal) | |
// New methods created below | |
@interface UIGestureRecognizer () | |
+ (void)hs_beginForcingAllNewGestureRecognizersToAllowPencilInput; | |
+ (void)hs_endForcingAllNewGestureRecognizersToAllowPencilInput; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>GridLayer Test</title> | |
<meta charset="utf-8" /> | |
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.0.1/dist/leaflet.css" /> | |
<style> | |
body { | |
padding: 0; | |
margin: 0; |
So, many places will give you clues how to get linear depth from the OpenGL depth buffer, or visualise it, or other things. This, however, is what I believe to be the definitive answer:
This link http://www.songho.ca/opengl/gl_projectionmatrix.html gives a good run-down of the projection matrix, and the link between eye-space Z (z_e
below) and normalised device coordinates (NDC) Z (z_n
below). From there, we have
A = -(zFar + zNear) / (zFar - zNear);
B = -2zFarzNear / (zFar - zNear);
OlderNewer