rotation in direction of normal
in
Programming Questions
•
1 year ago
In the sketch there is a sphere, the center and a line.
On the top of that line i want a ellipse to be drawn. Atm it's rotation is off and i have no clue how to solve it.
- import processing.opengl.*;
- void setup() {
- size(400, 400, OPENGL);
- smooth();
- }
- // . . . . . . . . . . . . . . . . . . .
- void draw() {
- background(255);
- lights();
- translate(width/2, height/2, -500);
- rotateX(map(mouseY, 0, height, 0, PI));
- rotateY(map(mouseX, 0, width, 0, PI));
- fill(200);
- noStroke();
- sphere(10);
- stroke(0);
- line(0, 0, 0, 200, 300, 150);
- translate(200, 300, 150);
- noFill();
- ellipse(0, 0, 50, 50);
- }
- // . . . . . . . . . . . . . . . . . . .
1