How to get a border around a single object?

As Ali said, the absolute simplest way possible is:
model.addLight(new AmbientLight(ColorRGBA.Pink.mult(4)));
…or something like that.

Remove it again when unselected. The light will only affect that model.

The next easiest way is to grab the world bound (a bounding box) and turn that into a wire frame attached to the model. The code for that is a little more complicated but straight forward.

Neither of these are “borders around the object” but will definitely serve as an indicator of which one is selected and you can move on to the next item on your to-do list.

Edit: and if you really do want a border around the object then the link from that other thread:

…really is the best you can do. It’s relatively simple. Always works, etc… It will draw outlines on things projecting towards the camera but often times that’s desirable.

…and the only way to get a true 2D border effect is to render the model off-screen and then calculate where it’s border would be using 2D approaches and render that image on the gui node over the object. Very complicated.

2 Likes