The Data Model (Intermediate)

1. Coloring Objects in DX
Let's learn some more details about the "colors" Component. This is probably the next most commonly encountered Component after "positions", "connections", and "data".

We've seen that we can create "colors" in a number of ways. So far, we've made "colors":

  • Automatically within some modules (Isosurface, for example)
  • By placing a Color module in line with an object to be colored and assigning a constant value ourselves
  • By placing an AutoColor in line with an object and letting AutoColor create a colormap internally based on the data values in the object

There are more ways to make colors.

Quit any program you may be running and start the Samples program "Color.net". When it launches, open the VPE and stretch it so you can see the modules.

This net illustrates three ways to add color. Look at the two output Images, then at the net.

Is it obvious which Image module corresponds to which Image window? If not, here's a trick: double-click on one or the other Image module on the VPE and its corresponding window will pop up. You may not see the effect if the Image windows are not covered or minimized; to get the full effect, close or minimize the Image windows to icons first, then double-click an Image module in the VPE and its window will pop up and open.

Here's another good idea: make the Image windows better documented. Once you know which module makes the Image with the blue and yellow isosurface, bring it to the front. Choose that Image window's Options menu: Change Image Name. . . choice. Enter any name you like that will help you keep the two images straight. You'll see the default name with the long pathname disappear and be replaced by your choice. Repeat for the second image. Naturally, this is saved when you save the program (though, here you don't need to save).

Now that we can tell the images apart, do an experiment. Rewire the net so that the left-hand Color module is skipped. I shouldn't have to tell you how to do this, but I will. Disconnect Image from Color, then either move the Isosurface-Color wire to become Isosurface-Image, or make a new wire from Isosurface to Image, leaving Isosurface-Color connected. Nothing should appear to happen. Read the next section to find out why.