orthonormal basis and right-hand rule
in
Programming Questions
•
1 year ago
Hi,
I am a new user of processing and I already have a big dilemma.
I try to draw a simple coordinate basis using this code:
In processing it seems that the left-hand is used then so z = -crossproduct(x,y) = crossproduct(y,x); (In the code I gave, the blue vecteur (Z), is pointing up while it should be down with the rigth hand rule).
Am I correct? If yes, is there any possibility to have a 3D environement which use the right-hand rule? I don't realy want to use the scale function.
Thanks a lot.
Bertrand
I am a new user of processing and I already have a big dilemma.
I try to draw a simple coordinate basis using this code:
- import processing.opengl.*;
void setup() {
size(600, 600, OPENGL);
smooth();
}
void draw() {
background(0);
strokeWeight(5);
translate(300,300,0);
drawAxes();
}
void drawAxes() {
pushMatrix();
rotateX(PI/6);
rotateZ(PI/6);
stroke(255, 0, 0);
line(-10, 0, 0, 50, 0, 0);
stroke(0, 255, 0);
line(0, -10, 0, 0, 50, 0);
stroke(0, 0, 255);
line(0, 0, -10, 0, 0, 50);
popMatrix();
}
In processing it seems that the left-hand is used then so z = -crossproduct(x,y) = crossproduct(y,x); (In the code I gave, the blue vecteur (Z), is pointing up while it should be down with the rigth hand rule).
Am I correct? If yes, is there any possibility to have a 3D environement which use the right-hand rule? I don't realy want to use the scale function.
Thanks a lot.
Bertrand
1