Skip to content

Instantly share code, notes, and snippets.

function webGLStart() {
var $id = function(d) { return document.getElementById(d); };
//Create moon
var earth = new PhiloGL.O3D.Sphere({
nlat: 30,
nlong: 30,
radius: 2,
uniforms: {
shininess: 32
function webGLStart() {
var $id = function(d) { return document.getElementById(d); };
//unpack modules
PhiloGL.unpack();
//create all models
var models = {};
//Create moon
models.moon = new O3D.Sphere({
//Create application
PhiloGL('canvasId', {
camera: {
position: {
x: 0, y: 0, z: -7
}
},
scene: {
lights: {
enable: true,
Ext.define('mynamespace.MySeries', {
alias: 'series.myseries',
extend: 'Ext.chart.series.Area',
type: 'myseries'
});
var mySeriesInstance = Ext.createByAlias('series.myseries', {
axis: 'left',
xField: 'name',
yField: ['data1', 'data2', 'data3'],
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Stack Simulator</title>
<link rel="stylesheet" type="text/css" href="../../../resources/css/ext-all.css" />
<script type="text/javascript" src="../../../bootstrap.js"></script>
<script>
Ext.require(['Ext.chart.*', 'Ext.data.*']);
//JSON used for the theme constructor (all sections are optional):
//all style attributes are the same as the ones used for
//Ext.draw.Sprite: http://docs.sencha.com/ext-js/4-0/#/api/Ext.draw.Sprite
var config = {
//general configuration on axes
axis: {
fill: '#000',
'stroke-width': 1
/* SASS like proposal: I'm not sure if this is correct since I didn't have the chance to look at the
new format. I hope this helps. */
.chart#mychart
axis
fill: '#000'
'stroke-width': 1
axisLabelTop
//Style objects and properties taken from Sprite properties: http://docs.sencha.com/ext-js/4-0/#/api/Ext.draw.Sprite
chart {
axis {
stroke: #444;
stroke-width: 1;
label {
fill: #444;
font: 12px Arial, Helvetica, sans-serif;
(function() {
//Unpack PhiloGL modules
PhiloGL.unpack();
var plane = new O3D.Plane({
type: 'x,y',
xlen: 2,
ylen: 2,
offset: 1,
program: 'quat',
var fs = require('fs');
var sys = require('sys');
['surf_reg_model_both_inflate_high.obj',
'surf_reg_model_both_inflate_low.obj',
'surf_reg_model_both_inflate_middle.obj',
'surf_reg_model_both_inflate_high.obj',
'surf_reg_model_both_normal.obj'].forEach(function(filename) {
fs.readFile(filename, 'utf-8', function(err, data) {