void addFace(ofMesh& mesh, ofVec3f a, ofVec3f b, ofVec3f c) {
ofVec3f normal = ((b - a).cross(c - a)).normalize();
mesh.addNormal(normal);
mesh.addVertex(a);
mesh.addNormal(normal);
mesh.addVertex(b);
mesh.addNormal(normal);
| // NOTE: For an actively-maintained version of this script, see https://github.com/mminer/consolation. | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| /// <summary> | |
| /// A console to display Unity's debug logs in-game. | |
| /// </summary> | |
| public class Console : MonoBehaviour | |
| { |
| #define _WIN32_WINNT 0x0500 | |
| #include <windows.h> | |
| #include <windowsx.h> | |
| #include <GL/gl.h> | |
| #include <GL/glu.h> | |
| #include <dwmapi.h> | |
| #pragma comment (lib, "opengl32.lib") |
| #include "SSLBuffer.h" | |
| SSLBuffer::SSLBuffer() | |
| :ssl(NULL) | |
| ,read_bio(NULL) | |
| ,write_bio(NULL) | |
| ,write_to_socket_callback(NULL) | |
| ,write_to_socket_callback_data(NULL) | |
| ,read_decrypted_callback(NULL) | |
| ,read_decrypted_callback_data(NULL) |
| #include <shared/VideoSurface.h> | |
| GLuint VideoSurface::prog = 0; | |
| GLint VideoSurface::u_pm = 0; | |
| GLint VideoSurface::u_mm = 0; | |
| GLint VideoSurface::u_tex = 0; | |
| GLfloat VideoSurface::pm[16] = {0}; | |
| VideoSurface::VideoSurface() | |
| :width(0) |
| string deviceName = "Logitech Camera"; | |
| vector<ofVideoDevice> devices = vidGrabber.listDevices(); | |
| for(vector<ofVideoDevice>::iterator it = devices.begin(); it != devices.end(); ++it) { | |
| if(it->deviceName == deviceName) { | |
| vidGrabber.setDeviceID(it->id); | |
| break; | |
| } | |
| } |
| // The main openFrameworks include | |
| #include "ofMain.h" | |
| // Poco is included in openFrameworks 0.8.0 | |
| #include "Poco/Net/HTTPClientSession.h" | |
| #include "Poco/Net/HTTPRequest.h" | |
| #include "Poco/Net/HTTPResponse.h" | |
| #include "Poco/Base64Encoder.h" | |
| #include "Poco/Net/HTMLForm.h" | |
| #include "Poco/Net/StringPartSource.h" | |
| #include "Poco/StreamCopier.h" |
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
float rand(float n){return fract(sin(n) * 43758.5453123);}
float noise(float p){
float fl = floor(p);
float fc = fract(p);
This is a short note about building cURL with SSL support on Windows
The following instructions are for creating your own animations using the style transfer technique described by Gatys, Ecker, and Bethge, and implemented by Justin Johnson. To see an example of such an animation, see this video of Alice in Wonderland re-styled by 17 paintings.
The easiest way to set up the environment is to simply load Samim's a pre-built Terminal.com snap or use another cloud service like Amazon EC2. Unfortunately the g2.2xlarge GPU instances cost $0.99 per hour, and depending on parameters selected, it may take 10-15 minutes to produce a 512px-wide image, so it can cost $2-3 to generate 1 sec of video at 12fps.
If you do load the