This article explains how to create a 3D sphere with pen on Scratch.

The Process

Method One: Using a Light Source

Step 1: Create a sprite which will be the "Light Source", and create the pen sprite.

Step 2: Create the following code in the pen sprite:

when gf clicked
generate sphere of size (100)

define generate sphere of size (sphere size)
set [v v] to [0]
repeat (sphere size)
  create circle of size (v)  // Remember to check the "run without screen refresh"! 
  change [v v] by (0.01)
end

define create circle of size (circle size)
repeat (360)
  pen down
  set pen color to (5) // The color of your sphere
  set pen shade to (distance to [Light Source v])
  turn right (1) degrees
  move (circle size) steps
end

Method Two: Pen Sprite Only

Step 1: Create the pen sprite.

Step 2: Do the same as Step 2, method 1, but replace the last script with this one:

define create circle of size (circle size)
repeat (360)
  move (circle size) steps
  pen down
  set pen color to (5) // reddish orange
  set pen shade to ([sqrt v] of ((((center x) - (x position)) * ((center x) - (x position))) + (((center y) - (y position)) * ((center y) - (y position))))) // Remember, (center x) is the x position of where it will be shaded, and (center y) is the y position of where it will be shaded.
  turn right (1) degrees
end

Examples

See also