How to limit adding an outline effect only to the geometry object instead of the transform controls attach on it?

How to limit adding an outline effect only to the geometry object instead of the transform controls attach on it?

I have created a geometry and added a transform control attach on it. After adding an outline effect to the geometry , the transform controls also have the outline effect. this is confusing, I want to understand the reason behind this and how can I only apply the outline effect to the geometry.

I only push one geometry to the outlinePass.selectedObjects,
outlinePass.selectedObjects = [node]
but all the transform controls(even attach on the other geometry) being added outline effect

How to limit adding an outline effect only to the geometry object instead of the transform controls attach on it?

the official example:
https://threejs.org/examples/?q=transform#misc_controls_transform

I modified the official example to create a minimal implementation.

image
image

I want to limit adding an outline effect only to the geometry object instead of the transform controls attach on it.

Thank you for reading and help…

I’m not quite happy with the following code, but you cay try whether it works for you. I made a change in function composerRender starting at line 36. This is the modified version:

function composerRender() {
    if( control ) control.visible = false;
    composer.render();
    if( control )
    {
        control.visible = true;
        renderer.autoClear = false;
        renderer.render( control, camera );
        renderer.autoClear = true;
    }
    requestAnimationFrame(composerRender);
  }

image

2 Likes

:smiling_face_with_three_hearts:Thank you so much for taking the time to help me with my three.js question! I really appreciate you providing a coded solution - it works perfectly to limit the outline effect to just the geometry object.

Your coding skills are impressive and I admire your ability to quickly understand the issue and come up with an elegant solution.

I learned a lot from seeing how you selectively set the visibility and customized the render calls. The extra effort you put into crafting your reply is so thoughtful. I’m grateful that you shared your knowledge to help me improve my own skills.Thanks again for being so generous with your time and expertise. It’s very kind of you. I hope I can pay it forward and help others the way you’ve helped me. You make the three.js community a better place!

1 Like