I'm attempting to understand how to use nodes and currently trying to create a material which involves a pair of alternating coloured stripes. Think of a barcode, or hazard stripes.

In my first attempt, I tried using a checker texture node, which took vector information from a mapping node. In this node, I used the point setting, and scaled it so that X and Y were .1, while Z was 1. The mapping vector information was then obtained from a generated texture coordinate node.

This seemed to be fine for two out of three axes, as the X and Y had stripes. However, I could not figure out how to apply the stripes to the Z axis, which remained a solid colour. I can see why this is so, but I don't know how to create an alternative solution.

Another limitation with what I tried is that if I were to set mapping rotation to 45 degrees for example, I would get solid colours on two axes, and triangular alternates on the third, which is definitely not what I'm trying to make.

So basically, how can I create a material which is striped in all axes, and can be rotated without any sort of distortion or deformation?

  • $\begingroup$ The thing is, any manifold will have at least 1 singularity, so it is mathematically impossible to create strips without disconnecting them. However if you would allow discontinuity you can create strips in 2 axis and other 2 axis and mix between them. (Can you do this?) Also, did you have a look at the wave texture node? $\endgroup$ – Omar Emara Jan 30 '17 at 18:07

Separate the generated texture coordinates vector, connect a math node set to sine to one of the coordinates, connect the output to a math node set to greater than, and connect that output to a mix RGB node.

enter image description here

The result:

enter image description here

If you want stripes on all sides, it is probably best to UV unwrap the mesh and use the UV texture coordinates as input for the node setup.

| improve this answer | |
  • $\begingroup$ Seems alright. I've added a mapping node between the first and second in your screenshot and tried giving it a 45 degree angle on the Z axis. I've noticed that the stripes adjust to the dimensions of the mesh, and is therefore only truly 45 degrees when the mesh is a cube (as opposed to a rectangle). Any idea how to work around that? $\endgroup$ – Hiigaran Jan 31 '17 at 14:34
  • $\begingroup$ I stretched the cube to twice its length and added a Mapping node and rotated by 45 degrees. The stripes stayed at 45 degrees. I used the Camera output of the Texture Coordinates. I confess that I don't know what using this output means, but it worked. $\endgroup$ – Phil Rogers May 10 '19 at 11:27

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.