FAQ
Cover
\
Build
\
Source
\
Bugs
\
Reference
\
Libraries
\
Tools
The bugs database has moved
here
.
Bug 339 : stroke() ignores screen translation in beginRaw()
Last modified: 2006-05-10 16:04
P
roject:
processing
trash
Version:
unspecified
Co
m
ponent:
android
book
core
libraries
pde
reference
tools
web
Status:
RESOLVED
Resolution:
FIXED -
Pr
i
ority:
P2
Severity:
normal
Platform
All
O
S:
All
Windows
Mac OS
Linux
Other
Reporter:
mark hill
Assigned To:
fry
Attachment
Type
Created
Size
Actions
.pde demonstrating problem with recursive stroke and beginRaw
text/plain
2006-05-05 01:49
1.41 KB
Description
: Opened: 2006-05-05 01:45
Using recursive stroke() with beginRaw() ignores screen translation.
This sketch will produce a file.pdf demonstrating the problem. The top left
of the .pdf shows what happens to strokes, whereas the middle portion shows
the correct screen translation using fill()
[code]
// produce a timelapse desync of image and map
// Appearing like apparitions
import processing.pdf.*;
import processing.opengl.*;
int res=48;
Point3D[][] points;
int wres, hres;
void setup() {
size(400, 300, OPENGL);
wres = width/res;
hres = height/res;
points = new Point3D[res][res];
for (int wx=0; wx<res; wx++)
{
for (int hy=0; hy<res; hy++)
{
points[wx][hy] = new Point3D((-width/2)+wx*wres, (-height/2)+hy*hres,
0, wx*width/res, hy*height/res);
}
}
}
void draw() {
translate(width/2, height/2,-250);
rotateY(mouseX*0.08);
if (rec)
beginRaw (PDF, "frame.pdf");
background(255);
drawMesh(); // use buffer to display the blurred brightness map.
if (rec)
endRaw();
rec = false;
}
boolean rec = false;
void mousePressed() {
rec = true;
}
// Draw mesh with texture
void drawMesh() {
if(!grid)
noStroke();
for(int i=0; i<res-2; i++)
{
beginShape(TRIANGLE_STRIP);
for(int j=0; j<res-1; j++)
{
fill ((int)random(0,255));
stroke ((int)random(0,255));
vertex(points[i][j].x, points[i][j].y, points[i][j].z);
vertex(points[i+1][j].x, points[i+1][j].y, points[i+1][j].z);
}
endShape();
}
}
public class Point3D {
float x, y, z, u, v;
Point3D (float x, float y, float z, float u, float v) {
this.x = x; this.y = y; this.z = z; this.u = u; this.v =v;
}
} // class
boolean grid = false;
[/code]
Additional Comment
#1 From mark hill 2006-05-05 01:49
edit
]
.pde demonstrating problem with recursive stroke and beginRaw
Sorry Ben, I also chucked the test case in with the registering of the bug.
Additional Comment
#2 From fry 2006-05-10 16:04
fixed for 0115, thanks for the report.