Loading...
Logo
Processing Forum
boplbopl's Profile
2 Posts
2 Responses
0 Followers

Activity Trend

Last 30 days
Show:
Private Message
    Hi people,
    since I've installed Processing 1.5, I've got an error with the parameters of my sliders. I want to control my parameters with sliders but also with the keys and then update the values:

    1. ...
    2. Slider s1 = controlP5.addSlider("dots", 0, dots, dots, 20, 120, 150, 15);
    3. s1.setAutoUpdate();
    4. ...

    during compilation I've got this message:
    "The function setAutoUpdate() does not exist"

    however it works and update the slider in Processing 1.2...

    anyone got an idea?

    thx


    hi people,
    I have a problem with rotations of ellipses around a sphere. I place my dots and ellipse in 3D like this:

    1. import processing.opengl.*;
    2. int canvasX = 250;    
    3. int canvasY = canvasX;    
    4. int canvasZ = canvasX; 
    5. int dots = 500;
    6. int radius = 150;
    7. float[] posX = new float[dots];
    8. float[] posY = new float[dots];
    9. float[] posZ = new float[dots];
    10. void setup() {
    11.   size(500,500, OPENGL);
    12.   frameRate(30);
    13.   background(0);
    14.   smooth();
    15. }
    16. void draw() {
    17.   noFill();
    18.   stroke(255);
    19.   translate(canvasX/2, canvasY/2);
    20.   for (int i = 0; i < dots; i++) {
    21.     float phi = posX[i]*TWO_PI;
    22.     float theta = PI - posY[i]*PI;
    23.     posX[i] = radius*sin(theta)*cos(phi)+canvasX/2;
    24.     posY[i] = radius*sin(theta)*sin(phi)+canvasY/2;
    25.     posZ[i] = radius*cos(theta)+canvasZ/2;
    26.     point(posX[i], posY[i],posZ[i]);
    27.     pushMatrix();
    28.     translate(posX[i], posY[i],posZ[i]);
    29.     //rotateX(???);
    30.     //rotateY(???);
    31.     ellipse(0,0,10,10);
    32.     popMatrix();
    33.   }
    34. }
    but I can find the way to rotate my ellipses to orient them in front of the center of the created sphere...like a "lookAt the center" property...or maybe a tangent stuff?
    anyone got an idea ?
    thx