drawing points instead of a line?
in
Programming Questions
•
2 years ago
I'm trying to create code that allows you to draw with the mouse (using pmouseX and pmouseY), although I want to create points along a 3D axis instead of a line.
By the time the code's finished, I'd like to be able to move a camera around the points to see what you've drawn, but in a 3D space.
Here's the example code for drawing a line using simple functions (it's rendering in P3D w/ lights() at the moment). Any easy way to turn that line into points? I also realize that there's the point() function, so I feel like that could possibly be part of the solution:
- void setup() {
- size(960, 640, P3D);
- background(102);
- smooth();
- }
- void draw() {
- lights();
- stroke(255);
- if(mousePressed) {
- line(mouseX, mouseY, pmouseX, pmouseY);
- }
- }
1