Accessibility
 
Home > Products > Director > Support > Basics of Director 3D
Macromedia Director Support Center - Basics of Director 3D
Adding a shader

Once the sphere has been created, click the second line of text ("Create Shader") to add a shader to the sphere with the Create Shader script. That script contains the following Lingo:

on mouseUp(me)  
    if voidP( sprite(1).member.shader("newShader")) then  
        tSprite = sprite(1)
        tMember = tSprite.member
        tTempShader = tMember.newShader("newShader", #standard) 
        tMember.model("newSphere").shader = tTempShader
        go next
    end if
end

Here is how the script works:

It makes sure the shader doesn't already exist.
It creates a new shader with the newShader() command.
It applies the shader to the sphere model.

Note that this step doesn't do anything visible —the sphere looks the same before and after. Adding the shader prepares the sphere for the addition of a texture that will change its appearance.

To Table of Contents Back to Previous document Forward to next document