Skip to content

Instantly share code, notes, and snippets.

var teapotMesh = {"verts":[{"x":5.929688,"y":4.125,"z":0},{"x":5.387188,"y":4.125,"z":2.7475},{"x":5.2971,"y":4.494141,"z":2.70917},{"x":5.832031,"y":4.494141,"z":0},{"x":5.401602,"y":4.617188,"z":2.753633},{"x":5.945313,"y":4.617188,"z":0},{"x":5.614209,"y":4.494141,"z":2.844092},{"x":6.175781,"y":4.494141,"z":0},{"x":5.848437,"y":4.125,"z":2.94375},{"x":6.429688,"y":4.125,"z":0},{"x":3.899688,"y":4.125,"z":4.97},{"x":3.830352,"y":4.494141,"z":4.900664},{"x":3.910782,"y":4.617188,"z":4.981094},{"x":4.074414,"y":4.494141,"z":5.144727},{"x":4.254687,"y":4.125,"z":5.325},{"x":1.677188,"y":4.125,"z":6.4575},{"x":1.638858,"y":4.494141,"z":6.367412},{"x":1.68332,"y":4.617188,"z":6.471914},{"x":1.77378,"y":4.494141,"z":6.684522},{"x":1.873438,"y":4.125,"z":6.91875},{"x":-1.070312,"y":4.125,"z":7},{"x":-1.070312,"y":4.494141,"z":6.902344},{"x":-1.070312,"y":4.617188,"z":7.015625},{"x":-1.070312,"y":4.494141,"z":7.246094},{"x":-1.070312,"y":4.125,"z":7.5},{"x":-1.070312,"y":4.125,"z":7},{"x":-4.007656,"y":4.125,"z":6
var meshBox = {
verts : [
v(-0.5,-0.5,-0.5), v(0.5,-0.5,-0.5), v(0.5,0.5,-0.5), v(-0.5,0.5,-0.5), // front
v(-0.5,-0.5,0.5), v(0.5,-0.5,0.5), v(0.5,0.5,0.5), v(-0.5,0.5,0.5), // back
],
tris : [
0,1,2, 2,3,0, // front
4,5,6, 6,7,4, // back
0,3,4, 4,3,7, // left
1,2,5, 5,6,2, // right
function setup()
{
createCanvas(700, 500);
background(220);
strokeWeight(10);
}
function transform(shape, angle, factor)
{
shape.x += shape.size * Math.cos(shape.angle);
function setup()
{
createCanvas(700, 400);
background(255);
}
var deg60 = Math.PI/3;
function addVector(x,y,angle,length)
{
var blob = [];
function setup()
{
createCanvas(800, 400);
background(128);
fill(100,12,12);
noStroke(); }
function draw() { if(mouseIsPressed)
function setup() {
createCanvas(400, 400);
}
var pilop = 38;
var pilned = 40;
var pilhøjre = 39;
var pilvenstre = 37;
var x = 2;
var y = 2;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
interface IBitStreamWriter
{
void SeekZero();
@pandr
pandr / FeetIK.cs
Created March 10, 2017 22:15
Snip about feet IK for Unity
// somewhere in your charactercontroller
public bool m_UseFeetIK = true;
public float m_FeetIkOffset = 0.0f;
void OnAnimatorIK()
{
if (m_Animator)
{
if (m_IsGrounded && m_UseFeetIK)
// Simple fps controller for unity
// To use, build this:
//
// Capsule
// Camera
//
// Put this script AND a CharacterController on the Capsule
// Link up camera to the "player_cam" property of this script
// Make sure Camera is positioned at (locally) 0, 0, 0 and with no rotation and scale
@pandr
pandr / strenge.js
Last active October 22, 2015 06:30
JavaScript Strenge
var fornavn = "Hans";
var efternavn = "Jensen";
var navn = fornavn + " " + efternavn; // "Hans Jensen"
var tom_streng = "";
var historie = "Der gik en hest";
var laengde = historie.length; // antal bogstaver i historien
var fundet = historie.indexOf("var");
var e = historie.charAt(1); // "e"