This site requires JavaScript, please enable it in your browser!
Greenfoot back
ronald
ronald wrote ...

2023/8/30

ZOOM and SPEED

ronald ronald

2023/8/30

#
Good morning i'm working on my mandelbrot set I'm looking for a way to speed up the zoom since it's not going fast thank you for your understanding
ronald ronald

2023/8/30

#
public void zoom() {
        
        double speed = 0;
        
        if (speed < -600)   speed = -600;
        if (speed > 600)    speed = 600;
        ZOOM += speed;
        if (ZOOM / 100 > getWorld().getWidth() - 1)
            if (ZOOM / 100 > getWorld().getHeight() - 1) 
                ZOOM += (getWorld().getWidth() - 1) / 10;
                ZOOM += (getWorld().getHeight() - 1) / 10;
        if (ZOOM < 0) 
            ZOOM = 0;
        update();
        
        /*
        ZOOM++;
        if (ZOOM < 100) ZOOM = 200;
        update();
        */
    }
rehi I found a speed and zoom code for the moment, the scenario is going faster than the first time I would like to be able to speed it up 5 times faster is it possible to do that with this code? Thanks for your help
danpost danpost

2023/8/30

#
ronald wrote...
i'm working on my mandelbrot set I'm looking for a way to speed up the zoom since it's not going fast
The problem with this is that creating one screen for the mandelbrot set takes a lot of computation -- so much that processing time will be the pacesetter. You can do things to help the situation a bit, like reducing the size of the screen (the less number of pixels to compute colors for, the better); and reducing the number of steps to eliminate a point from the mandelbrot set (less accurate, but less processing).
ronald ronald

2023/8/30

#
and yes, it's a lot of calculation java is also mathematics. I haven't found many explanations on the net about where you can get the zoom speed the zoom already has its speed when it grows or shrinks and you have to add another speed to it to zoom faster I thought about reducing the number of ifs for iterations or reduce the number of colors... I'll see what I can do as usual, danpost thank you again
ronald ronald

2023/8/31

#
one last explanation about these two codes HSB to RGB from what I understand, float hue is the color red ie int red saturation = green and brightness = blue this is what i understand hsb is converted to rgb or all red green and blue colors are converted to hue in the RGB to HSB case. hue is one color or 3 colors? thank you for your explanation
float hue = hueShift + plasma[y][x] % 1;
img.setRGB(x, y, Color.HSBtoRGB(hue, 1, 1));
ronald ronald

2023/8/31

#
OK this is a hex code for 3 RGB colors and hsl are percentages of hue clarity, saturation and lightness and the color blue in hsb is h / 255, s / 255, b /255 cad (0.9f,0.5f,0.8f) approximately. I'm coming back to HSL, so it's for a color too??? I get lost a little Thanks for your help
You need to login to post a reply.