I can't make my lorenz attractor balls opaque help pls

Hello again!

  fill(255, 255, 0, 128); //yellow and opacity 128
  noStroke();
  sphere(3); // raio das bolota

At the end of function draw():

function draw() {
//background(0);

// Your code...

fill(0, 10);  //black and opacity 10
rectMode(CENTER);
rect(0, 0, width, height);
}

Always fill() before the shape!

My background was black so that is why I chose black… you may have to change things on your end.

Experiment a little… I was just playing around with this and was done very quickly.

You can always go back and edit your code… as a new user you may have some limitations and have to wait a day.

This will be off the screen:
rect(windoWidth, windowHeight, windoWidth, windowHeight);

I suggest you visit the p5.js web page for tutorials, examples and references and it also has an editor:

In the p5.js editor on web page I added this to function setup() so it was initially black:
background(0);

I was using the Processing p5 mode editor initially.

This was in the p5.js editor with my suggested code changes:

:)

1 Like