We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
JMyron library and P3D (Read 1021 times)
JMyron library and P3D
Oct 11th, 2008, 9:12pm
 
Hi everyone,

This is my first post here and i need your help!

I'm writing a code with JMyron library and i'm getting problems when rendering the video capture mixed with a cube rotating on itself... Some parts of the cube disappear and reappear randomly.

I need to use the JMyron library because of the globs detections advantages.

I tried with all the processing versions and it doesn't work.
I tried with OPENGL and still no positive results

I'm on an Intel Mac (Tiger)

Thanks and have a nice day!

CODE HERE :

+++++++++++++++++++++++++++++

import JMyron.*;

JMyron video;//a camera object
float rotation = 0;

void setup(){
 size(320,240, P3D);
 fill(255);
 stroke(0);
 video = new JMyron();//make a new instance of the object
 video.start(width,height);//start a capture at 320x240
 
 video.findGlobs(0);//disable the intelligence to speed up frame rate
 println("Myron " + video.version());
}

void draw(){
 rotation+=0.01;
 video.update();//update the camera view
 int[] img = video.image(); //get the normal image of the camera
 
 loadPixels();
 for(int i=0;i<width*height;i++){ //loop through all the pixels
     pixels[i] = img[i]; //draw each pixel to the screen
     
 }
 updatePixels();
 
 // draw the cube
 translate(width/2, height/2, 0);
 rotateY(rotation);
 box(100);
}

public void stop(){
 video.stop();//stop the object
 super.stop();
}
Re: JMyron library and P3D
Reply #1 - Oct 12th, 2008, 1:18pm
 
you need to translate backwards a bit. if you draw a cube at z = 0, the shape will be momentarily flying into the screen and past the camera. check out the coordinate system section of help > getting started.
Re: JMyron library and P3D
Reply #2 - Oct 12th, 2008, 4:45pm
 
Yeah i already tried to modifiy the information on the Z position in translate but the problem is still there.
I think the problem is in the way JMyron library display the video... It just don't seem to work with 3D elements.

Maybe someone know an other library who could give the individual center point of multiple glob?

Thanks!!
Page Index Toggle Pages: 1