Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
fabritw
fabritw's Profile
2
Posts
1
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
change character spacing?
[2 Replies]
13-Dec-2012 05:22 AM
Forum:
Programming Questions
Is there a way to change the character spacing or do I have to load a new font? Thanks!
fill(255);
f = createFont("Arial", 20*4, true);
textFont(f);
textSize(52);
text("TEST", -190, -110);
creating pattern for texture on sphere
[1 Reply]
12-Dec-2012 10:01 AM
Forum:
Programming Questions
Hi, I would like to find out the best way to create a pattern out of a triangle shape I have created.
I would like to use this pattern as a texture on a sphere. Please can anyone advise me?
I've included the code for the pattern below:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
PShape pattern, bulb;
// Setup Environment
size(600, 600, P2D);
pattern = createShape(GROUP);
background(0);
noStroke();
smooth();
// Setup Variables
int[][] colours = {
{255,255,255},
{255,255,255},
{255,207,133},
{253,198,95},
{252,252,132},
{243,241,244},
{246,204,86},
{250,196,106}
};
int dot_width = 18;
int x_pos = dot_width;
int y_pos = dot_width;
int row_length = 8;
int point_length = 8;
int point_offset = 0;
// Setup Dots Pattern
for (int row = 0; row < row_length; row++) {
for (int x = 0; x < point_length; x++) {
int offset = x_pos + point_offset;
bulb = createShape(
ELLIPSE,
offset,
y_pos,
dot_width,
dot_width
);
bulb.fill(
colours[row][0],
colours[row][1],
colours[row][2]
);
pattern.addChild(bulb);
x_pos += dot_width * 2;
}
x_pos = dot_width;
y_pos += 30;
point_length -= 1;
point_offset += dot_width;
}
beginShape(TRIANGLE_FAN);
shapeMode(CORNER);
shape(pattern);
endShape();
saveFrame("panel.png");
«Prev
Next »
Moderate user : fabritw
Forum