home about gallery publications education links contact

..::CD colour animation::..

The trick to producing this type of light scattering effect is to closely look at how the actual phenomenon is actually produced. As the CD surface is reflective, you do get a reflection however the rays themselves are produced by light entering the sides of the CD ( the outer and inner side surfaces) and internally reflecting, like a prism producing the scattering of light colours. Rotating the CD results in different light sources being internally reflected and producing different colours, and it’s this procedure that you need to simulate.

The light rays can be easily produced with a Gradient Ramp map, and its rotation generated by simply wiring the offset value(s) to the rotation of the actual object. This yields a pretty uniform effect so as there are multiple light sources in a room, depending on light types (their wavelengths), the breakup of colours may be more dispersed or more refined, so add additional Gradient Ramp maps to simulate these additional light sources. These can be added numerous times with a Composite map, though to get the rays to start at different angles you will need to nest the wired controller within a List controller to your can dial in some additional offset with a Bezier controller (see the included sample scene). Couple this with a reflection of the scene and some ray strength masking and the effect can be pretty convincing at a glance!

However, you really have to bear in mind that this particular solution is very a quick and dirty one; it may look aesthetically right, but an actual CD’s colour dispersal only appears to change by a large degree when the CD surface is facing you, after which there isn’t that much change in ray rotation as you get to the extremes of the CD’s tilt angle. Therefore some rotational clamping via expressions may be required. You may want to take this further and adapt the scene so that the angle of the rays is generated from light angle positioning in relation to the CD and the viewing camera (offset slightly due to the internal reflection and refraction of the CD surface) so you get a more “accurate” internal scattering effect!

Enlarge Screenshot The CD material setup appears to be complex, but it’s actually a blend of various map controls to mask off bits of the CD where reflections and colour rays are required.
Enlarge Screenshot The rotation of the colour rays is derived from the object’s rotation controller via wiring, so that when the object is rotated the Gradient Ramp map’s offset value is automatically amended.
Download the max file! Zip file to accompany.

..::quick tip::..

Try adapting the scene by getting the colour flags in the Gradient Ramp map to change their RGB values depending on the rotation of the CD object (HINT: each flag’s colour has a controller!)

Initially published: 3D World magazine, Issue 104, June 2008.

Copyright Pete Draper, June 2008. Reproduction without permission prohibited.