We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
Y-Axis Points Down (Read 535 times)
Y-Axis Points Down
Dec 22nd, 2008, 1:00am
 
Hi I have set up a 3d axis, drawing a line for the x-axis, y-axis, and z-axis. Positive X values point to the right, positive Z values point out towards the screen, and positive Y values point DOWN.

If I want the positive values of the Y-axis to point UP instead of DOWN, what would I change?
Re: Y-Axis Points Down
Reply #1 - Dec 22nd, 2008, 1:09am
 
Code:

translate(0, someHeight, 0);
...
int getY(oldY){
int newY = - oldY;
return newY;
}

?
Re: Y-Axis Points Down
Reply #2 - Dec 22nd, 2008, 1:30am
 
Yes I realize I can just represent all my Y-coordinates as negative, but it gets a bit hairy when working with the mechanics, angles, and rotations. I was just wondering if it's possible to change the coordinate system to one where Y points up?
Re: Y-Axis Points Down
Reply #3 - Dec 22nd, 2008, 1:35am
 
Sorry, I was half joking when I wrote that.

But since you are likely to be working with vectors, why not subclass them with similar methods?
Re: Y-Axis Points Down
Reply #4 - Dec 22nd, 2008, 1:39am
 
Thanks I'll look in to overriding the classes to account for it, I didn't think of that.
Re: Y-Axis Points Down
Reply #5 - Dec 22nd, 2008, 2:07pm
 
scale(1,-1,1); should do it.
Re: Y-Axis Points Down
Reply #6 - Dec 22nd, 2008, 3:03pm
 
That's a better answer by million-fold.
Page Index Toggle Pages: 1