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.
IndexProgramming Questions & HelpSyntax Questions › Why aren't the axes cartesian
Page Index Toggle Pages: 1
Why aren't the axes cartesian? (Read 2641 times)
Why aren't the axes cartesian?
Apr 21st, 2005, 4:59pm
 
I've been thinking about this for a while.  But haven't understand it yet, I was hoping to have some answers here.

Why the Z axis is inversed  In a cartesian space, a vectorial product of the X unitarian vector and the Y unitarian it should result in the Z unitarian vector, in Processing it results in the -Z unitarian vector.

maybe it's a bit of nonsense, it's been quite a while since I haven't studied these things.

I ask this, because the rotateX(), rotateY() and rotateZ() senses of rotations are not clear for me.

I'm grounding my comments on the schema in this link:
http://processing.org/reference/environment/index.html#Coordinates
Re: Why aren't the axes cartesian?
Reply #1 - Apr 21st, 2005, 5:06pm
 
In Processing +Y is down, not up (I guess this would be a "left-hand coordinate system?). I'm still not 100% convinced for why this is, but I've accepted it. Wink This is the axis flip that's probably confusing you.
Re: Why aren't the axes cartesian?
Reply #2 - Apr 21st, 2005, 5:11pm
 
Well, I think that by flipping any one of the axes, we get a cartesian system.  I was just thinking of the Z axis, because it's the added axis to the 2D system.
Re: Why aren't the axes cartesian?
Reply #3 - Apr 21st, 2005, 5:18pm
 
The explanation I was given is that the X and Y axis orderings persist from 2D to make the transition to 3D "easier". As you say, Z is simply "added" to the system for 3D which results in the non-standard axes.
Re: Why aren't the axes cartesian?
Reply #4 - Apr 21st, 2005, 5:49pm
 
Ok, so if the Z was simply added, it could have been added in the other sense (twoards the back of the screen) instead of twoards the front of the screen or the viewer (as it is now).
Re: Why aren't the axes cartesian?
Reply #5 - Apr 21st, 2005, 6:57pm
 
right, for 2D graphics we're used to 0,0 in the upper left. but if you don't like it, all it takes is a call to perspective(), and maybe another to camera() to set things up in any way you see fit:

http://processing.org/reference/perspective_.html

we're not forcing anything, just providing what we find to be the sensible default for our primary audience.
Re: Why aren't the axes cartesian?
Reply #6 - Apr 21st, 2005, 8:31pm
 
aaaaah!!! neeeeet, this camera() function, just what I was looking for.  a simple flip (1.0 for it's value) on the upY component would make the axes cartesian, no?

I hope you didn't think I was proposing to change the axes.  It wasn't at all what I meant, I was just trying to understand why of that sense for the axes.  Now I do.

This camera function is great and provides the freedom fry mentioned.  good work.

One little question what are the default camera values, that would a nice addition to the reference.

Another little question is what would be the difference of using the structure beginCamera() and endCamera() with the lookat() inside:
Code:

beginCamera();
resetMatrix();
translate(...);
rotateX(...);
rotateY(...);
rotateZ(...);
lookat(...);
endCamera();

or using a simple camera() function:
Code:

camera();

Are these expressions equivalent, but separated in order to:
-optimize (on speed and calculus) when making changes to some of the camera values and not all
or
-allow different approaches to the camera positioning

The other little thing I don't understand is these new functions: perspective() and frustrum()
Are these two different ways (different parameters) in order to define the same thing (the projection matrix).

Or am I just mixing all the concepts up???
sorry if there's some nonsense in what I say.

ricard
Page Index Toggle Pages: 1