In this tutorial, you will discover how to create a complete animation friendly 7 segment display with Blender for rendering in Cycles.
The logic inside will be controlled by a specially created node. It is contained in the Sharkigator Node Collection, so you’ll have to download it first.
Creating the first digit
First of all, you’ll have to create a mesh for the display.
Below, I’ve modeled a simple mesh. I kept the segments single objects, so it is easier to work with them.
The numbers show the segment indices. This will be important in the next step.
|Fig. 1 | Full size.|
Now we have to assign Vertex Colors, to identify the single segments. Segment 1 will get a vertex color value of 0.1, Segment 2 gets 0.2 and so on.
Make sure to paint the whole segment with that color. You can use the shortcut Shift+K to quickly fill the whole segment (if it is a separate object).
|Fig. 2 | Full size.|
When you’re done with that you can join all the segments together (Ctrl+J) to one single object.
If you now look into Vertex Paint mode, it should look something like this:
|Fig. 3 | Full size.|
Now also rename the Vertex Color set to something like “Segment”.
Now we can create the material.
First, make sure that you’ve set the render engine to Cycles.
Then open up the node editor and create a new material for the display.
Add the 7 Segment node (inside the Sharkigator Node Collection, file: Cycles.blend/NodeTree).
Then add a Input>Attribute node and set it’s name to “Segment” (remember, this was the name of the Vertex Colors).
Now take the Fac output and plug it into the Vertex Colors input of the 7 Segment node.
The Number input will decide which number is displayed. This value can be keyframed.
You can now see the result now by using a Emission node and switching to rendered viewport shading. (See setup below.)
|Fig. 5 | Full size.|
Creating a multi digit display
So now you’ve got a one digit display. But what if you want to display more than one digit?
Fortunately, extending to a multi digit display is pretty straightforward.
First, add a second Vertex Color set and name it “Digit”. It will identify which digit is which.
Then duplicate the mesh for the one digit.
In Vertex Paint mode, set the color to 0.0 for the right digit and 0.1 for the left one. (on the Vertex Color set “Digit”! Leave “Segment” untouched!)
|Fig. 7 | Full size.|
Back in the node editor, add another Input>Attribute node and set the name to “Digit”.
Add a Converter>Math node, set the operation to Power and set the second input to “1 / 2.2” (which will turn into 0.455).
Connect the Fac output of the Vertex Colors with the Power node’s first input.
Add a second Converter>Math node, set the operation to Multiply and set the second input to 10.
Connect the output of the Power node to the first input of the Multiply node.
Now take the Multiply node’s output and connect it to the Digit input of the 7 Segment node. (See below.)
|Fig. 8 | Full size.|
And now you’re done!
You can add more digits the same way, e.g. the third digit would get a Vertex Color value of 0.2 and so on.
Thank you for reading, I hope this was helpful.
If you use this somewhere, it makes me happy if you tell me about it. (E. g. in a comment.)
Also, if you can create a video tutorial about this, that would be great!
If you did that, please give me notice, so I’ll provide a link here.