Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
manuel.novoa
manuel.novoa's Profile
2
Posts
3
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
pass from RandomMotion to gravity with nexttext
[0 Replies]
30-Nov-2012 07:39 PM
Forum:
Contributed Library Questions
hi!
I try to move text from RandomMotion to gravity usin nexttext librarie
like this:
***************************
Selector selector;
selector = new Selector();
selector.add("RandomMotion", new RandomMotion());
AbstractAction gravity = new Gravity(0.12);
Behaviour gravityBehaviour = gravity.makeBehaviour();
selector.add("Gravity", gravityBehaviour); <-- bad code!!
how make this work??
thanks!!
newb help with Texture Cylinder
[4 Replies]
23-Oct-2012 07:42 AM
Forum:
Programming Questions
Hi
i try to draw a Texture Cylinder, but always missing part of the cylinder.
int tubeRes = 30;
float[] tubeX = new float[tubeRes];
float[] tubeY = new float[tubeRes];
PImage img;
void setup() {
size(640, 360, P3D);
img = loadImage("berlin-1.jpg");
float angle = 360.0 / tubeRes;
System.out.println(" angle :"+angle);
for (int i = 0; i < tubeRes; i++) {
tubeX[i] = cos(radians(i * angle));
tubeY[i] = sin(radians(i * angle));
}
noStroke();
}
void draw() {
background(0);
translate(width / 2, height / 2);
rotateX(map(mouseY, 0, height, -PI, PI));
rotateY(map(mouseX, 0, width, -PI, PI));
beginShape(QUAD_STRIP);
texture(img);
for (int i = 0; i < tubeRes; i++) {
float x = tubeX[i] * 100;
float z = tubeY[i] * 100;
float u = img.width / tubeRes * i;
vertex(x, -100, z, u, 0);
vertex(x, 100, z, u, img.height);
System.out.println(" u:"+u+" 0 " +img.height);
}
vertex(x, -100, z, u, 0);
vertex(x, 100, z, u, img.height);
endShape();
}
what is the wrong??
thanks!
«Prev
Next »
Moderate user : manuel.novoa
Forum