Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Complex shape character outline

Say I have this character and I want allow user to select it, so when it s selected I want to show an outline around it.

enter image description hereenter image description here

the character is an object3D with some meshes. I tried to clone and set a backside material, but it did NOT work, the problem was each cube in the shape was render with backside separately so the outline was wrong.

do I need to create another mesh for the outline, is there an easier way?

like image 892
Ashkan Ghodrat Avatar asked Jul 19 '13 06:07

Ashkan Ghodrat


People also ask

What do shapes say about a character?

Understanding shape language in character design Shape Language is a concept used in art and 3D animation to communicate meaning based on shapes we are familiar with. When used in character design, shapes can tell a story, show personality, and illicit an emotional response in the viewer without using any words.


1 Answers

What @spassvolgel wrote is correct;

What I suspect needs to be done is something like this: 1. First the background needs to be rendered 2. Then, on a separate transparent layer, the character model with a flat color, slightly bigger than the original, 3. On another transparent layer the character with its normal material / texture 4. Finally, the character layer needs to go on top of the outline layer and them combined need to be placed in the bg

You just create multiple scenes and combine them with sequential render passes:

renderer.autoClear = false;
. . . 

renderer.render(scene, camera); // the entire scene
renderer.clearDepth();
renderer.render(scene2, camera); // just the selected item, larger, in a flat color
renderer.render(scene3, camera); // the selected item again

three.js.r.129

like image 63
WestLangley Avatar answered Sep 22 '22 14:09

WestLangley