Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
ddalgibbang
ddalgibbang'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
Very Basic Coding Question..
[4 Replies]
21-Jan-2012 04:53 PM
Forum:
Programming Questions
Hello...
I'm very new to Processing and I'm having trouble trying to rotate my drawing on the Y-axis...
Basically, I'm trying to get the fish to flip over when it gets to the left side of the window.
I have:
import processing.opengl.PGraphicsOpenGL;
int fishX = 247;
int fishY = 138;
int x;
int changeX = 1;
void setup() {
background(231, 253, 255);
size(800, 400, OPENGL);
smooth();
}
void draw() {
x = x + changeX;
int newWid = width-fishX;
translate (newWid-x, height/2-fishY/2);
if (x < 0 || x > width-fishX) {
changeX = changeX * -1;
if (x < 0) {
rotateY(PI);
}
else {
rotateY(0);
}
}
fish(); }
while fish() is just a method I created to draw my fish..
My code isn't working.. the fish just bounces off the left wall and continues backwards....
What am I doing wrong? Do I need push and popMatrix()?
I know it probably isn't the most efficient way to do this... But I just want it to work... T_T
Thank you!
Processing won't run on my Mac..
[2 Replies]
21-Jan-2012 01:06 AM
Forum:
Integration and Hardware
Hello,
I'm pretty new to Processing.. and I just can not get it to run... and I really need this program :(
Please help me out....
I'm trying to run it on a OS 10.6.8 and I've been getting this error:
Thank you!
«Prev
Next »
Moderate user : ddalgibbang
Forum