Straight lines along x y or z

I decided that I wanted to make vegetables so I modeled a carrot and an onion. I was trying to figure out how to align one of the blender internal wood textures so that it would be striped up the carrot like a carrot is supposed to be. I wanted the onions stripes running from pole to pole (sorta like lines of longitude on the earth i guess).

I just can’t figure out the right alingment that gives those results. I figured there had to be a way to do it without UV-mapping and exporting a map and making a texture from scratch (which takes annoying amounts of effort.) I gave up after a while with not good enough results.

However, as fate would have it, I was in the neighborhood of the texturing department so I thought I’d ask the question.

To align textures to the local x, y, and z axis, you simply select the orco button for coordinates.

You could use a wood texture. Then set the map input settings for the texture to:

  • Orco Co-ordinates
  • Then, fiddle around with the cluster of “<blank>, x, y, z” buttons so that you have two (or more) similar ones selected.

Aligorith

As some help:
In Object mode, select your carrot. Hit the F7 key. In the “Draw” pane, push the “Axis” button.
Now, in the 3D view, you will see the “Orco” axes on your carrot, they will look like little arrows at the object center labeled with X, Y, and Z.

For a carrot, you want the line texture to be at right angles to the long axis of the carrot, so it make rings around the carrot. Examine the axes to see if the carrot’s long axis is X, Y, or Z.

In the MapTo panel for the texture, you want Cylindrical mapping. I’m pretty sure that Blender assumes that the texture cylinder’s long axis is the Z axis. Say that your carrot’s long axis is the Y axis. In the MapTo panel, in the second to the last row, unclick the Y button and click the Z button. In the last row, unclick the Z button and click the Y button. This tells Blender to use the Y axis as the texture cylinder’s long axis.

If the carrot’s texture is running parallel to the long axis instead of at 90 degrees, go to the texture context with F6, select the texture image, in the Image pane, click the Rot9 button to rotate the texture by 90 degrees.

Do the same for the onion, except you want Sphere mapping instead of Cylinder mapping.