did anybody hear about a decent port of the toxiclibs library to c++ so they can be used within of/cinder? There's one 'port' which is 3 years old and only covers a couple of classes:
https://github.com/hlp/toxiclibs--
I've already started developing the port, but I simply want to make sure it doesn't exist yet.
i wrote a small sketch demonstrating what should happen in in processing 1.5. it is basically the same functionality as in the working version of the thread above. this is what it looks like:
i want to achive the same effekt (cube mapping) with processing 2.0. and since the glgraphics library from of andres should be included mostly into processing 2.0 it should be no problem- i just dont know enough of the inner workings of processing with opengl in combiation with shaders to make it work. my status looks like this: (you can see the back strokes of the sphere that should have the reflections of the cube map on it):
maybe somebody can help me to get this to work. i zipped up both versions for you to debug here:
i want to use shaders on a pshape object within processing 2. i got a sketch running which is doing the same thing in processing 1.5 with the glgraphics library:
the important parts of the code look like that:
import codeanticode.glgraphics.*;
import processing.opengl.*;
import peasy.*;
GLSLShader shader;
GLModel torus;
PeasyCam cam;
void setup()
{
size(800, 600, GLConstants.GLGRAPHICS);
// one-shot shader load and initialise
shader = new GLSLShader(this, "check.vs", "check.fs");
// needed for the native GL commands in the torus rendering
GLGraphics renderer = (GLGraphics) g;
renderer.beginGL();
background(50);
// start shader processing -- anything between start() and stop()
// will be handled by our new vertex/fragment shaders.
shader.start();
// render a donut object
renderer.model(torus);
// stop shader processing
shader.stop();
renderer.endGL();
}
I read that the equivalent object of the 1.5 GLModel is PShape(3D) in 2.0 but i could not get it to work. The code of my processing 2 code to do the same looks like that:
import processing.opengl.*;
import toxi.geom.Vec3D;
import peasy.*;
PShader shader;
PShape torus;
PeasyCam cam;
void setup()
{
size(800, 600, P3D);
// one-shot shader load and initialise
shader = loadShader("check.fs", "check.vs");
// simple camera handling
cam = new PeasyCam(this, 150);
torus = createTorus( 40, 40, 40, 40, 40, 40);
}
void draw()
{
PGraphicsOpenGL gl = (PGraphicsOpenGL) g;
PGL pgl = gl.beginPGL();
shader(shader);
background(50);
// start shader processing -- anything between start() and stop()
// will be handled by our new vertex/fragment shaders.
//shader.start();
// render a donut object
//renderer.model(torus);
shape(torus);
// stop shader processing
//shader.stop();
//renderer.endGL();
}
and produces the following output :
i put both sketches here, maybe somebody can figure out to reproduce the stripe-shader on a pshape in processing 2!
in the past days i was working on a library for the leap motion. there are other wrappers around bringing the leap data into processing. unfortunately those wrappers do not work on windows, thats why i wrote a library myself, working on all plattforms (
OSX & Windows) and with
all processing versions and the
newest version of the leap motion sdk.
one of my main goals for the library was to include some proper
gesture recognition, since having data about fingers in space is funny for the first moment but not really going anywhere. moreover i wanted to turn the library in a 'processing-way' so its fits in nicely with the way processing works and people who use processing work (!).
it is possible to use the library in an 'expert' way, as well as in an 'easy-access-quick' way. check out the examples.
hey, ich have the following problem and i hope somebody of you might know a solution:
check out the following code:
import processing.video.*;
Movie movie;
PGraphics pg;
PShader shader;
void setup() {
size(600, 600, P3D);
pg = createGraphics(320, 180, P2D);
movie = new Movie(this, "clipcanvas.mp4");
movie.loop();
shader = loadShader("edges.glsl");
}
void draw() {
background(0);
translate(width/2-200, height/2);
rotateY(sin(frameCount/60.0));
drawOnPG();
if(mousePressed){
image(pg, 0, 0);
} else {
image(movie, 0, 0);
}
}
/**
* the movie needs to be drawn on a pgraphics
* inbetween in order to be able to apply a
* shader on the video
*/
void drawOnPG() {
pg.beginDraw();
pg.shader(shader);
pg.image(movie, 0, 0);
pg.endDraw();
}
void movieEvent(Movie m) {
m.read();
}
when you run the sketch you will see that, when you keep the mousebutton pressed and the video is rotated, the "further away"-part of the video is not animated/moving anymore. this gets really annoying when increase the distance of the camera to the video even more, because then the entire video is stuck.
you can see the different to the sketch running without you pressing the mouse, then it works how it should be. the problem only occurs when you draw the video to a PGraphics inbetween, which is needed when you want to apply a shader on a video.
1. is there a way to apply a shader to a video without buffering it into a pgraphics inbetween?
2. is there any way to avoid the bug of the video not moving anymore?
here you can download the sketch including the video. its only 1mb, so dont worry.
I am currently working with Processing 2.0a4 and I wonder if anybody else has the same problem:
When running the sketch below in standard mode everything is okay. But when i render it in javascript mode it doesn't smooth/antialias the lines. Am I doing something wrong or is there any other way to smooth/antialias in processingjs?