1. First step is to explore color in the Wolfram Language. Make a list of colors. Add purple, black and orange to the list:
In[]:=
{Red,Green,Blue}
Out[]=
{,,}
You can specify a color by saying how much red, green and blue it contains. There’s a function that lets you say that. Try other values of red, green and blue (numbers must stay between 0 and 1)
Note: This gives maximum red, with no green or blue:
RGBColor[1,0,0]
This gives maximum green, with no red or blue. Can you figure out how to generate the color yellow with RGBColor?:
RGBColor[0,1,0]
Interactively view the colors and their RGB values with a color picker:
Note: [Click in the color bar to see with the RBG value is for that color.
Manipulate[FullForm@color,{color,Purple}]
We need to choose 5 colors to make up the creeper. Here are 5 standard colors:
RGBColor/@
,
,
,
,
0 |
0.6 |
0 |
0 |
0.5 |
0 |
0 |
0.9 |
0 |
0.7 |
1. |
.72 |
.5 |
0.76 |
0.26 |
Choose your own 5 colors for the creeper. Use the color picker to see the RGB values of 5 colors that you choose. Replace the numbers in colorValues with your own colors:
Manipulate[FullForm@color,{color,Purple}]
colorValues=
,
,
,
,
;
0 |
0.6 |
0 |
0 |
0.5 |
0 |
0 |
0.9 |
0 |
0.7 |
1. |
.72 |
.5 |
0.76 |
0.26 |
Lots of code needed to create a Creeper. This first set of code is going to create a pattern or skin for the creeper:
matrix:=Partition[RandomChoice[colorValues,90],10]
matrix2:=Partition[RandomChoice[colorValues,100],10]
creeperSide:=Image[matrix,ColorSpace"RGB"]
creeperSide2:=Image[matrix2,ColorSpace"RGB",ImageSize100]
creeperSide
Second block of code is needed to create the 3D elements of the creeper. Such as the body, head and legs:
Note: Just evaluate :)
vtcHead={{0,0},{1.8,0},{1.8,1.8},{0,1.8}};coordsHead={{{0,0,0},{0,1,0},{1,1,0},{1,0,0}},{{0,0,0},{1,0,0},{1,0,1},{0,0,1}},{{1,0,0},{1,1,0},{1,1,1},{1,0,1}},{{1,1,0},{0,1,0},{0,1,1},{1,1,1}},{{0,1,0},{0,0,0},{0,0,1},{0,1,1}},{{0,0,1},{1,0,1},{1,1,1},{0,1,1}}};vtcBody={{0,0},{1,0},{1,2.5},{0,2.5}};coordsBody={{{0,.2,0},{0,.8,0},{1,.8,0},{1,.2,0}},{{0,.2,-2},{0,.8,-2},{1,.8,-2},{1,.2,-2}},{{0,.2,0},{1,.2,0},{1,.2,-2},{0,.2,-2}},{{0,.8,0},{1,.8,0},{1,.8,-2},{0,.8,-2}},{{0,.2,0},{0,.8,0},{0,.8,-2},{0,.2,-2}},{{1,.2,0},{1,.8,0},{1,.8,-2},{1,.2,-2}}};vtcLeg={{0,0},{1,0},{1,1},{0,1}};coordsFrontLeg={{{0,-.2,-2},{0,.2,-2},{1,.2,-2},{1,-.2,-2}},{{0,-.2,-2},{0,-.2,-2.5},{1,-.2,-2.5},{1,-.2,-2}},{{0,-.2,-2.5},{0,.3,-2.5},{1,.3,-2.5},{1,-.2,-2.5}},{{0,.3,-2},{0,.3,-2.5},{1,.3,-2.5},{1,.3,-2}},{{0,-.2,-2},{0,-.2,-2.5},{0,.3,-2.5},{0,.3,-2}},{{1,-.2,-2},{1,-.2,-2.5},{1,.3,-2.5},{1,.3,-2}}};coordsBackLeg={{{0,.7,-2},{0,1.1,-2},{1,1.1,-2},{1,.7,-2}},{{0,.7,-2},{0,.7,-2.5},{1,.7,-2.5},{1,.7,-2}},{{0,.7,-2.5},{0,1.2,-2.5},{1,1.2,-2.5},{1,.7,-2.5}},{{0,1.2,-2},{0,1.2,-2.5},{1,1.2,-2.5},{1,1.2,-2}},{{0,.7,-2},{0,.7,-2.5},{0,1.2,-2.5},{0,1.2,-2}},{{1,.7,-2},{1,.7,-2.5},{1,1.2,-2.5},{1,1.2,-2}}};
Put it all together:
creeperDone=Graphics3D[{Texture[creeperSide],Polygon[coordsHead,VertexTextureCoordinatesTable[vtcHead,{6}]],Texture[creeperSide2],Polygon[coordsBody,VertexTextureCoordinatesTable[vtcBody,{6}]],Texture[creeperSide],Polygon[coordsFrontLeg,VertexTextureCoordinatesTable[vtcLeg,{6}]],Polygon[coordsBackLeg,VertexTextureCoordinatesTable[vtcLeg,{6}]]},AxesTrue,TicksNone]
Show your creeper to the world:
CloudDeploy[creeperDone,"myCreeper",Permissions"Public"]
Setting permissions for public viewing of the cloud version:
In[]:=
SetPermissions[CloudObject["http://www.wolframcloud.com/objects/ef8c3d58-99c1-4fc0-a0c1-f4afab181aca"],"Public"]
Out[]=
{AllAutomatic,Owner{Read,Write,Execute}}