I am having an issue here that when I am attempting to increase the resolution of the webcam when using the nyartoolkit library which is working fine on processing 1.5, the object does not render the object 'face on' even if
the marker is straight in front of the camera, it will load the object slanted.
It looks fine when opened on the original example resolution (640,480), you can see the object 'face on'
however if the resolution increased to anything higher than that, like
768x576 this is what happens:
this is the current code:
/**
NyARToolkit for proce55ing/1.0.0
(c)2008-2011 nyatla
airmail(at)ebony.plala.or.jp
最も短いARToolKitのコードです。
Hiroマーカを用意してください。
This sample program is most small sample as simpleLite.
I am trying to load a .obj file, however only a small section of the texture appears at the back of the head. Sketch folder includes the .obj file and .mtl and a corresponding image file. Not sure why this is happening?
I know that the Pshape function works in processing 2.0 but for compatibility with the nyartoolkit library i need it to be in 1.5 so i am using the original simple example code from OBJloader library. Any ideas or suggestions please?
Here's the code:
import saito.objloader.*;
OBJModel model ;
float rotX, rotY;
void setup()
{
size(800, 600, P3D);
frameRate(30);
model = new OBJModel(this, "Untitled.obj", "absolute", TRIANGLES);
model.enableDebug();
model.scale(1,1,1);
model.translateToCenter();
stroke(255);
noStroke();
}
void draw()
{
background(129);
lights();
pushMatrix();
translate(width/2, height/2, 0);
rotateX(rotY);
rotateY(rotX);
model.draw();
popMatrix();
}
boolean bTexture = true;
boolean bStroke = false;
void keyPressed()
{
if(key == 't') {
if(!bTexture) {
model.enableTexture();
bTexture = true;
}
else {
model.disableTexture();
bTexture = false;
}
}
if(key == 's') {
if(!bStroke) {
stroke(255);
bStroke = true;
}
else {
noStroke();
bStroke = false;
}
}
else if(key=='1')
model.shapeMode(POINTS);
else if(key=='2')
model.shapeMode(LINES);
else if(key=='3')
model.shapeMode(TRIANGLES);
}
void mouseDragged()
{
rotX += (mouseX - pmouseX) * 0.01;
rotY -= (mouseY - pmouseY) * 0.01;
}
The obj loader should not have an issue with loading a single texture?
I am trying to make it so a gif file i made loops and randomly duplicates all over the screen, at the moment i have this very basic code that i have patched together which works for a small line that i tested:
I would like to ask, after exporting a processing file, I am aware that you can click exe/app icon and the program will run offline however is there a way to integrate the program inside another program? For example, the interactive videos you can create in adobe flash cs6 that allow you to press buttons and access different videos, would I be able to integrate an exported processing program into that?
Ideally I am hoping for an interface that will display buttons that gives the viewers access to different pieces of ideas/videos and it would open up the processing application through one of the buttons. Is there any way of doing this offline- perhaps in mock up website in Dreamweaver? Or would it be only possible online?
I am hoping there will be people knowledgable in this area or any suggestions for
methods of sharing processing work?
Thank you, please, any suggestions would really be greatly helpful and appreciated!
I am very new to this but find processing a fun and experimental experience. I am currently interested in the slit scan processing by Golan Levin.
I have been spending hours trying to figure out how to change the direction of the scan to go from left to right in larger sections rather than little slivers of imagery from the webcam.
I have tried to change this part to capture larger sections from the video camera to be displayed but no luck so far:
videoSliceX = video.width / 2;
I think this part may be the start position of the shown images?
drawPositionX = width - 1;
From some trial and error I think have narrowed the area that needs to be changed for the position to be continuously drawn:
I have been researching and trying to understand these variables and codes from the processing.org tutorials and example part of the website, but there are still some things I don't understand like the coding "width - 1" or "height - 1"- it seems to indent from the right or top if the numbers are changed, but if it is changed to +, the program won't work.
I am a real beginner and very inexperienced and would greatly appreciate any help/support here as my own attempts with code modification won't work and I really want to start learning about processing in a more accurately informed manner.
Thank you for your time!
Here is the code I have been looking at:
/**
* Simple Real-Time Slit-Scan Program.
* By Golan Levin.
*
* This demonstration depends on the canvas height being equal
* to the video capture height. If you would prefer otherwise,
* consider using the image copy() function rather than the
* direct pixel-accessing approach I have used here.
*/
import processing.video.*;
Capture video;
int videoSliceX;
int drawPositionX;
void setup() {
size(600, 240, P2D);
// Uses the default video input, see the reference if this causes an error
video = new Capture(this, 320, 240);
video.start();
videoSliceX = video.width / 2;
drawPositionX = width - 1;
background(0);
}
void draw() {
if (video.available()) {
video.read();
video.loadPixels();
// Copy a column of pixels from the middle of the video