3D scene without any shading

Hello, I need the objects in a rotating 3d scene without light and shadow, only with solid “smooth” colors. The idea is to use the touchscreen to select individual objects in the rotating scene, even if they cover each other.

So I let the scene rotate photorealistically with light and shadow on the screen and at the same time the scene without light and shadow in the background.

If I now click in the photorealistic scene, I can use the same coordinates in the flat scene to see which object was just in front … I use the H value from the HSV color space for this.

How do I get the renderign without light and shadow?

1 Like

You can draw on a PGraphics pg and say pg.noLights();

The PGraphics must have the same size as your canvas.

Then you can perform checks on the canvas.

You can then draw objects (in the rotating 3d scene) with different unique colors and get() the colors from pg which would identify the single objects.

Use

color clickedObj = pg.get(mouseX,mouseY);

cf. Looking for more resources about ArrayLists - #45 by Chrisir

1 Like

Take a look here for some options:

A related topic:

The last topic discusses a variety of approaches!
Don’t let it complicate your world and work on a solution you can understand from the ground up.

:)