13
$\begingroup$

Is it possible to make a dot matrix look with cycles?

I attempted this with the following node setup:

enter image description here

However, the dots should be round, and each dot should only have one color. As you can see, this is not the case:

enter image description here

This was possible in BI with a technique described on the wiki.

How can I achieve this?

$\endgroup$
22
$\begingroup$

How about something like this?

Dot matrix example

Or, even more fun:

Glowing dotmatrix – what could be better!

Or a ball:

So much fun

Or a tribute to the question author:

Yet another "example"

(I am having way too much fun with this)

The dot aspect ratio depends on your UV unwrap, so you can customize it as you want. I have gotten them to be square on a non-square image, but having a square image makes it a lot easier. Workflow:

  1. Identify the nearest hole.
  2. Find the distance to the hole.
  3. If the distance is greater than the radius, use transparent. Otherwise, use the central color of the center of the hole.

EDIT: GitHub user @JayFoxRox has kindly suggested some helpful simplifications to the below node setup. Instead of computing distance by taking the square root of the sum of the squares of components, simply compute squared distance by taking the dot product of the two inputs via the Vector Math node. (Then, of course, compare this to the squared radius instead of the raw radius.) And the “Combine Vector” and “Separate Vector” node groups now exist as first-class “Combine XYZ” and “Separate XYZ”, anyway. Thanks!

Blendfile: Dropbox, Blend-Exchange.

Usage:

How to use this node group

Main node setup (right-click → Open Image in New Tab to see larger):

Main node group, "DotMatrix"

Separation (top) and combination (bottom): (would be nicer if it were built-in)

Node groups "Separate Vector" (top) and "Combine Vector" (bottom)

Distance: (Pythagorean theorem/Euclidean norm)

Node group "Distance"

$\endgroup$
  • $\begingroup$ @Mentalist: Thanks for rehosting the link. $\endgroup$ – wchargin Feb 23 '18 at 23:10
  • $\begingroup$ Great job, very useful could I ask a question? How can change the number of dot matrix? Thanks in advance france $\endgroup$ – france Sep 25 '18 at 13:42
  • $\begingroup$ @france Have you tried playing with the "spacing" and "radius" inputs? $\endgroup$ – gandalf3 Sep 25 '18 at 14:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.