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
#include "Vec.h" | |
Vec Vec::cross(Vec o) { | |
Vec r; | |
r.x = y*o.z - z*o.y; | |
r.y = z*o.x - x*o.z; | |
r.z = x*o.y - y*o.x; | |
return r; | |
} |
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
#include "Camera.h" | |
//The arch-dependent stuff | |
inline void Camera::firstUpdate() { | |
#ifdef WIN32 | |
QueryPerformanceFrequency((LARGE_INTEGER*)&pFreq); | |
QueryPerformanceCounter((LARGE_INTEGER*)&pLastUpdate); | |
#else | |
gettimeofday(&pLastUpdate, NULL); |
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
Q=(function() { q = "Q=(" + Q.toString() + ")()"; document.write(q); })() |
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
var G = new Graph(canvasElement); |
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
var graphJSON = G.toJSON(); | |
G.fromJSON(graphJSON); |
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
G.setOption('isEditable', true); |
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
G.save("my graph") | |
//get a list of all graphs that are currently saved | |
var savedGraphs = G.getSavedGraphsList(); | |
G.load(savedGraphs[0]); |
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
//draw vertices as green circles | |
G.setOption('vertexDrawFunction', | |
//v is a vertex object with x and y attributes. | |
function(ctx,v,graph) { | |
ctx.beginPath(); | |
ctx.fillStyle= '#0f0'; | |
ctx.arc(v.x,v.y, 5,0,10,false); | |
ctx.fill(); | |
ctx.closePath(); |
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
function loadGraph(canvasId, gid) { | |
var canvas = document.getElementById(canvasId); | |
var G = new Graph(canvas); | |
$.get(gServer, | |
{ type: "graph", id: gid }, | |
function(data) { | |
G.fromJSON(data[0]["graph"]); | |
}); | |
return G; | |
}; |
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
<div id="fb-root"></div> | |
<script src="http://connect.facebook.net/en_US/all.js#appId=1234512345&xfbml=1"></script> | |
<fb:login-button show-faces="true" width="200" max-rows="1"></fb:login-button> |
OlderNewer