Skip to content

Instantly share code, notes, and snippets.

@gero3
gero3 / syntax.sl
Last active December 31, 2019 10:02
Define TwoNumbers {
Number a;
Number b;
}
Number a;
Number b;
var fs = require("fs");
function getMethods(obj) {
var allPages = {};
for (var category in obj) {
var pages = obj[category];
/* Remove Link Outlines */
a, a:active, a:focus { outline: none; -moz-outline-style: none; }
:-moz-any-link:focus { outline: none; -moz-outline-style: none; }
*, *:focus, *:active { outline: none; -moz-outline-style: none; }
@gero3
gero3 / robot.js
Created December 4, 2012 22:05
test Robot
function Robot(robot) {}
// well, we need to do something...
// whenever our robot is idle, this method gets called.
Robot.prototype.onIdle = function(ev) {
var robot;
robot = ev.robot;
robot.ahead(150);
robot.rotateCannon(360);
@gero3
gero3 / robot.js
Created December 4, 2012 22:00
gero3' Robot
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(100);
@gero3
gero3 / issue
Created September 12, 2012 11:08
issue
## introduction
This is a suggestion on how we could make use of preprocessor definitions inside a shadermaterial.
## Why
I needed a shadermaterial that had more then 16 texture uniforms defined but depending on the configuration of my application only used 16 or less texture uniforms. So I needed the rebuild my shader sourcecode programmatically or I could make a definition system which used preprocessor definitions.
## definition
@gero3
gero3 / definition.js
Created September 12, 2012 09:31
description of shadermaterial
/*global THREE:true requestAnimationFrame:true shaders:true*/
var shaders = {
splat:{
defines : {"USE_DIFFUSE2" : true},
uniforms:{
"alpha1" : { type: "t", value: null },
"diffuse1" : { type: "t", value: null },
"multiplier1" : {type: "f", value: 16.0 },
@gero3
gero3 / ray.js
Created August 17, 2012 07:23
test for ray.js
THREE.Ray=function(L,M,N,O){this.origin=L||new THREE.Vector3;this.direction=M||new THREE.Vector3;this.near=N||0;this.far=O||Infinity;var q=new THREE.Vector3,p=new THREE.Vector3,r=new THREE.Vector3,v=new THREE.Vector3,s=new THREE.Vector3,D=new THREE.Vector3,t=new THREE.Vector3,u=new THREE.Vector3,E=new THREE.Vector3,w=new THREE.Vector3,m=new THREE.Vector3,x=new THREE.Matrix4,G=function(a,c){return a.distance-c.distance},g=new THREE.Vector3,h=new THREE.Vector3,j=new THREE.Vector3,H,I,c,J=function(a,
F,b){g.sub(b,a);H=g.dot(F);I=h.add(a,j.copy(F).multiplyScalar(H));return c=b.distanceTo(I)},n,i,o,k,y,z,A,B,C=function(a,c,b,f){g.sub(f,c);h.sub(b,c);j.sub(a,c);n=g.dot(g);i=g.dot(h);o=g.dot(j);k=h.dot(h);y=h.dot(j);z=1/(n*k-i*i);A=(k*o-i*y)*z;B=(n*y-i*o)*z;return 0<=A&&0<=B&&1>A+B},K=1E-4;this.setPrecision=function(a){K=a};this.intersectObject=function(a,g){var b,f=[];if(!0===g)for(var d=0,h=a.children.length;d<h;d++)Array.prototype.push.apply(f,this.intersectObject(a.children[d],g));if(a instanceof
THREE.Particle)
@gero3
gero3 / ray.js
Created August 17, 2012 07:23
test for ray.js
THREE.Ray=function(L,M,N,O){this.origin=L||new THREE.Vector3;this.direction=M||new THREE.Vector3;this.near=N||0;this.far=O||Infinity;var q=new THREE.Vector3,p=new THREE.Vector3,r=new THREE.Vector3,v=new THREE.Vector3,s=new THREE.Vector3,D=new THREE.Vector3,t=new THREE.Vector3,u=new THREE.Vector3,E=new THREE.Vector3,w=new THREE.Vector3,m=new THREE.Vector3,x=new THREE.Matrix4,G=function(a,c){return a.distance-c.distance},g=new THREE.Vector3,h=new THREE.Vector3,j=new THREE.Vector3,H,I,c,J=function(a,
F,b){g.sub(b,a);H=g.dot(F);I=h.add(a,j.copy(F).multiplyScalar(H));return c=b.distanceTo(I)},n,i,o,k,y,z,A,B,C=function(a,c,b,f){g.sub(f,c);h.sub(b,c);j.sub(a,c);n=g.dot(g);i=g.dot(h);o=g.dot(j);k=h.dot(h);y=h.dot(j);z=1/(n*k-i*i);A=(k*o-i*y)*z;B=(n*y-i*o)*z;return 0<=A&&0<=B&&1>A+B},K=1E-4;this.setPrecision=function(a){K=a};this.intersectObject=function(a,g){var b,f=[];if(!0===g)for(var d=0,h=a.children.length;d<h;d++)Array.prototype.push.apply(f,this.intersectObject(a.children[d],g));if(a instanceof
THREE.Particle)
{
"metadata": {
"formatVersion": 3,
"generatedBy": "Blender 2.60 Exporter",
"vertices": 224,
"faces": 200,
"normals": 86,
"colors": 0,
"uvs": 0,
"materials": 1,