Hi
I'm having a go at making a turn-the-page album. I've managed to turn one page; code below. When the turning "page" is facing me edge on, the perspective is unnaturally exaggerated. I think the solution is to push the vanishing point much further away.
Playing with the z value of translate (together with the image size) does not fix it.
Any ideas?
Thanks
string
Code://originated from
//TexturedCube by Dave Bollinger
PImage square1;
float rotY = 0.0;
void setup()
{
size(400, 200, P3D);
noStroke();
square1 = loadImage("square01.jpg");
textureMode(NORMALIZED);
}
void draw()
{
background(255);
translate(width/2, height/2, -100);
rotateY(rotY);
picturePage(square1);
}
void picturePage(PImage square1)
{
beginShape(QUADS);
texture(square1);
vertex(0, -100, 0, 0, 0);
vertex(200, -100, 0, 1, 0);
vertex(200, 100, 0, 1, 1);
vertex(0, 100, 0, 0, 1);
endShape();
}
void mouseMoved()
{
rotY = map(mouseX, 0, width, -PI, 0);
}