Best/Fastest way to make objects visible/invisible

Started by Melssj5, April 01, 2018, 06:29:23 AM

Previous topic - Next topic

Melssj5

Hi friends, I am soing an app in which I must show or hide objects from my world depending on the user input..... Actually I am doing:

1: Clean (Remove all the objects3D that chould be hidden, some of them are not even in the world)
2: Adding to the world all the objects from (1:) that have to been shown
3: build the objects
4: render the world


I am constantly receving error messages that the object didnt exists on the world when trying to remove them.....

Will this way affect performance ans estability??

Which should be the best way to show or hide objects from my world. Maybe moving them to a far position out of the camera scope instead of removing them and moving them again instead of rebuilding them??? wich other aproach should I use??
Nada por ahora

AeroShark333

I thought Object3D had a method to set their visibility, not quite sure though.
Object3D.setVisibility(false);

Another solution could be to place the Object3D 'behind' the camera

EgonOlsen

Yes, just set the visibility to false. That's cheap. You can have hundreds of invisible objects in a scene. It shouldn't hurt.