const float PI = 3.1415926535897932384626433832795;
const float PI_2 = 1.57079632679489661923;
const float PI_4 = 0.785398163397448309616;
float PHI = (1.0+sqrtf(5.0))/2.0;
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
// Kudos to armadilly | |
fbo.begin(); | |
///pre-multiply background color of the fbo for correct blending! | |
ofClear(ofColor(fboBgColor * (fboBgColor.a / 255.) , fboBgColor.a)); | |
//Set this blending mode for anything you draw INSIDE the fbo | |
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); | |
//your draw code here! | |
fbo.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
varying vec2 vUv; | |
uniform sampler2D tDiffuse; | |
uniform float isPicking; | |
uniform vec3 pickingColor; | |
void main() { | |
vec3 color = texture2D(tDiffuse, vUv).rgb; | |
gl_FragColor = vec4(color, 1.0); |
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
import THREE from 'three' | |
import Config from 'config' | |
let config = Config.instance | |
var isLow = false |
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
import THREE from 'three' | |
import Config from 'config' | |
let config = Config.instance | |
let parameters = { | |
parameters : false, |
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
addTouchEvent() { | |
console.log('readd') | |
this.wrapper = document.querySelector('.wrapper') | |
let bla = ["touchstart", "touchend", "touchmove"] | |
bla.forEach( (func)=> { |
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
this.tInput = this.webGL_createTexture(2048.0, this.GL.RGBA, this.GL.NEAREST, this.GL.NEAREST, this.GL.UNSIGNED_BYTE, true); | |
WebglFrag.prototype.webGL_createTexture = function(textureSize, format, maxFilter, minFilter, type, unBind) { | |
var texture = this.GL.createTexture(); | |
texture.size = textureSize; | |
this.GL.bindTexture(this.GL.TEXTURE_2D, texture); |
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
var ncp = require('ncp').ncp; | |
var copyobj = require('../package.json').copy; | |
for (var prop in copyobj) { | |
ncp(copyobj[prop].src, copyobj[prop].dest, function (err) { | |
if (err) { | |
return console.error(err); |
I added a few methods to three-orbit-controls to be able to manually define phi or theta and be able to rotate to a given point.
// rotation in Y
controls.setAzimuthalAngle(theta);
// rotation in X
controls.setPolarAngle(phi);