Skip to content

Instantly share code, notes, and snippets.

View cedricpinson's full-sized avatar

Cedric Pinson cedricpinson

View GitHub Profile
@cedricpinson
cedricpinson / shadernode
Last active August 29, 2015 14:10
shader node api tests
var inputVariables = [ a, b, c];
var outputVariable = factory.getVariable('vec4','outputResult');
factory.getNodeAdd().inputs(inputsVariables).output(outputVariable);
var normal = this.getOrCreateNormal();
var lightingInputs = {
lights: lights
normal: normal,
@cedricpinson
cedricpinson / emacs-jshint-reporter
Created January 3, 2014 13:01
Emacs reporter for jshint in compile buffer
/*jshint node: true */
var reporter_name = "jhlint";
module.exports = {
reporter: function (data) {
"use strict";
var str = '',
errors = [];
var uploadModel( modelAsBlob, filename ) {
var fd = new FormData();
var model = modelAsBlob;
fd.append( "fileModel", model, filename );
fd.append( "filenameModel", filename );
// for PRO
@cedricpinson
cedricpinson / gist:5303099
Last active May 28, 2019 06:51
camera animation
var sketchfabModule = window['sketchfab-iframe'];
var moduleVersion = sketchfabModule.version;
var Sketchfab = sketchfabModule.Sketchfab;
var Q = sketchfabModule.Q;
var urlid = "z9Psf5XIvSeuJYiMnuBgeRjLwql";
var iframeWindow = $('#myIframeCamera')[0];
var options = {
"nocamera": 1,
@cedricpinson
cedricpinson / gist:5303078
Created April 3, 2013 16:59
start stop example
var sketchfabModule = window['sketchfab-iframe'];
var moduleVersion = sketchfabModule.version;
var Sketchfab = sketchfabModule.Sketchfab;
var Q = sketchfabModule.Q;
// example with only start stop
var urlid = "z9Psf5XIvSeuJYiMnuBgeRjLwql";
var iframeWindow = $('#myIframe')[0];
var api = new Sketchfab(iframeWindow);
@cedricpinson
cedricpinson / gist:5295874
Created April 2, 2013 20:26
lookat command
var promise = lookat( [ 0,13,10], // eye position
[0,10,0], // target to lookat
4.3); // duration of the animation
@cedricpinson
cedricpinson / gist:5295831
Created April 2, 2013 20:21
stop command
var promise = stop();
@cedricpinson
cedricpinson / gist:5295809
Created April 2, 2013 20:18
start command for sketchfab-iframe
var promise = start('lryj5P1gwkVTmAI53wdqfmUWFym', {
"nocamera": 1, // no camera animation at start
"autostart": 1, // start when loaded
"transparent": 1, // set the background transparent
"controls": 0, // remove the control UI
"desc_button":0, // remove description UI
"stop_button":0 // remove the stop button
});
@cedricpinson
cedricpinson / upload_model.sh
Created December 7, 2012 20:25
bash/curl upload model to sketchfab
#!/bin/bash
path="./"
filename="Ellly.blend"
file=${path}${filename}
description="Test of the api with a simple model"
token_api="ff00ff"
title="Uber Glasses"
tags="test collada glasses"
private=1
#!/usr/bin/ruby
# -*- coding: utf-8 -*-
require "uri"
require "net/https"
require "base64"
require 'rubygems'
require "json"
screenshot="../data/thumbnail.png"