Skip to content

Instantly share code, notes, and snippets.

@lg3bass
lg3bass / Midi2MayaAnimation.mel
Last active January 19, 2020 21:36
MEL - Midi 2 Maya Animation
#maya.py [maya 2014]
#midi to animation script
import sys
import math
#sys.path.append('/Users/lg3bass/BW_MCP/BW_PROJECTS/BW_3D/MAYA_projects/MIDI_PY/midi/Up1_LR.mid')
#put the midiparser.py file in X:/Program Files/Autodesk/Maya2011/Python/lib so you don't need to specify the path explicitly
import midiparser
import pymel.core as pm
start_note="C,1"
@ofZach
ofZach / gist:8829491
Created February 5, 2014 17:53
smooth line drawing input for openframeworks
#include "testApp.h"
// this can go in your h file;
ofPoint pts[5];
uint ctr;
ofPath path;
ofPolyline lineOrig;
@MartinBspheroid
MartinBspheroid / gist:8902181
Last active November 16, 2022 05:39
openFrameworks hacks (win64)
// TESTED ON nightly-build ver 0.8 (of_v20130813) in Visual Studio 2012 - Win64
// MAKE APP ALWAYS ON TOP
HWND AppWindow = GetActiveWindow();
SetWindowPos(AppWindow, HWND_TOPMOST, NULL, NULL, NULL, NULL, SWP_NOMOVE | SWP_NOSIZE);
// DISABLE FUNCTION DESCRIBED ABOVE
HWND AppWindow = GetActiveWindow();
@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active April 4, 2025 07:45
GLSL Noise Algorithms

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
@roymacdonald
roymacdonald / ofApp.cpp
Created August 25, 2015 04:19
openframeworks audio pasthrough
#include "ofApp.h"
//--------------------------------------------------------------
void ofApp::setup(){
int bufferSize = 256;
ofSoundStreamSetup(2, 2, this, 44100, bufferSize, 4);
}
@thennequin
thennequin / DisplayInImGui.cpp
Last active November 16, 2022 16:00
Ini Config Reader/Writer
Ini::IniConfig& m_oIniConfig;
Ini::CategoryValueMap& mCategories = m_oIniConfig.GetCategories();
if (ImGui::Button("Reload"))
{
m_oIniConfig.Load("Config.ini", true, false);
}
ImGui::SameLine();
if (ImGui::Button("Save"))
// pie menu test
// v0.00
#include <imgui_internal.h>
// Return >= 0 on mouse release
// Optional int* p_selected display and update a currently selected item
int PiePopupSelectMenu(const ImVec2& center, const char* popup_id, const char** items, int items_count, int* p_selected)
{
int ret = -1;
@thennequin
thennequin / ColorPicker.cpp
Created December 22, 2015 11:25
Color picker
bool ColorSelector(const char* pLabel, ImVec4& oRGBA)
{
const ImU32 c_oColorGrey = ImGui::ColorConvertFloat4ToU32(ImVec4(0.75f,0.75f,0.75f,1.f));
const ImU32 c_oColorBlack = ImGui::ColorConvertFloat4ToU32(ImVec4(0.f,0.f,0.f,1.f));
const ImU32 c_oColorBlackTransparent = ImGui::ColorConvertFloat4ToU32(ImVec4(0.f,0.f,0.f,0.f));
const ImU32 c_oColorWhite = ImGui::ColorConvertFloat4ToU32(ImVec4(1.f,1.f,1.f,1.f));
ImGui::PushID(pLabel);
bool bRet = false;
ImGuiID iID = ImGui::GetID(pLabel);
1. User
- GET /api/users.json - get all users list
- POST /api/users.json - user registration with Firebase sync
data format
{
user: {
email: '',
password: '',
fullname: '',
sex: 'F|M',
@HalfdanJ
HalfdanJ / alphafbo.cpp
Created May 25, 2016 19:00
ofFbo with premultiplied alpha
// Kudos to armadilly
fbo.begin();
///pre-multiply background color of the fbo for correct blending!
ofClear(ofColor(fboBgColor * (fboBgColor.a / 255.) , fboBgColor.a));
//Set this blending mode for anything you draw INSIDE the fbo
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
//your draw code here!
fbo.end();